Skip to content

feat: invoice history icon in top bar, visible under the billing paywall - #1844

Open
giladresisi wants to merge 1 commit into
mainfrom
feat/invoice-history-icon
Open

feat: invoice history icon in top bar, visible under the billing paywall#1844
giladresisi wants to merge 1 commit into
mainfrom
feat/invoice-history-icon

Conversation

@giladresisi

Copy link
Copy Markdown
Collaborator

What kind of change does this PR introduce?

Feature.

Why was this change needed?

Customers who cancel their subscription drop to the FREE tier and hit the billing paywall, which blocks the settings/billing page - so they can no longer see or download their past invoices, and several unsubscribed customers asked for exactly that.

This adds a small invoice icon in the top-right header (between the organization switcher and the light/dark toggle) that opens a read-only Invoices modal: Date / Amount / Status per charge, with a download link to the Stripe invoice PDF (or receipt). It is a read-only version of the admin Manage Billing modal - no checkboxes, no refund/coupon/cancel buttons. The icon renders in both the normal layout header and the paywall screen's separate header (the whole point - cancelled users live on that screen), and only when billingEnabled && isGeneral, so self-hosted instances never see it.

Backend: one new endpoint, GET /billing/invoices, returning the caller's own org charges via the existing StripeService.getCharges. Charges are fetched lazily - only when the modal opens, never on layout mount. The superAdmin-only GET /billing/charges admin endpoint is untouched.

Includes lingo.dev translations for the new invoices key.

Other information:

Tested locally against real Stripe test data: populated modal (3 charges, correct amounts/status), empty state ("No charges found") for orgs without charges, paywall header via an impersonated FREE-tier org, and the download link click-through to the Stripe-hosted receipt/invoice page. Frontend and backend production builds pass.

Checklist:

  • I have read the CONTRIBUTING guide.
  • I have signed the Contributor License Agreement (CLA) (ICLA for individuals, CCLA for entities).
  • I confirm I have not used AI to submit this PR or generate code for it.
  • I checked that there were no similar issues or PRs already open for this.
  • This PR fixes just ONE issue

🤖 Generated with Claude Code

Customers who cancel their subscription drop to FREE tier and hit the
billing paywall, which blocks the settings page - so they could no longer
download their past invoices. This adds a small invoice icon in the
top-right header (between the organization switcher and the mode toggle)
that opens a read-only Invoices modal listing the org's past charges with
a download link per charge. The icon is rendered in both the normal layout
header and the paywall screen's separate header, and only when
billingEnabled && isGeneral.

Backend: new GET /billing/invoices returning the caller's own org charges
via the existing StripeService.getCharges (lazy - fetched only when the
modal opens). The superAdmin-only GET /billing/charges admin endpoint is
untouched.

Includes lingo.dev translations for the new `invoices` key.

Testing (local dev, real Stripe test data):
- Normal header: icon appears, modal lists 3 real charges with correct
  date, amount ($X.XX USD) and Paid status; no checkboxes or admin
  footer buttons.
- Paywall: impersonated a FREE-tier org with a Stripe customer - the
  paywall header shows the icon and the modal opens (empty state
  "No charges found" for an org with no succeeded charges).
- Download link verified: clicking the row's download icon opens the
  Stripe-hosted receipt/invoice page in a new tab with working
  "Download invoice" / "Download receipt" buttons.
- GET /billing/invoices returns 200 [] for an org without charges and
  the charge list otherwise; frontend + backend production builds pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@postiz-contribution postiz-contribution Bot added the contribution:approved Approved contributor label Aug 4, 2026
@postiz-agent

postiz-agent Bot commented Aug 4, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution:approved Approved contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant