The member's invoice list and invoice page show Stripe's invoice-level period, not the period the invoice pays for #293
Closed
opened 2026-10-30 00:40:03 +00:00 by cgalo5758
·
1 comment
Labels
Clear labels
accessibility
area/billing
area/catalog
area/discourse
area/domains
area/entitlements
area/fedwiki
area/identity
area/integrations
area/licensing
area/member-ui
area/meta
area/operator-ui
area/ops
area/testing
duplicate
good-first-issue
invalid
privacy
security
upstream
wontfix
A barrier for people using assistive technology or a keyboard alone.
The Stripe mirror, checkout, subscriptions, invoices, fulfillment.
Products, prices, plan ladders, purchasability.
The Discourse integration.
The domains registry, claims, placements, the certificate ask.
Entitlement sets, rules, grants, pools, provisioning.
The Federated Wiki integration and farm sync.
Sign-in, sessions, persons, organizations, workspaces, roles.
The provider registry, outbox and webhooks in general.
Licenses, the contributor agreement, SPDX headers.
Member pages.
The repository itself, its contributing guide, CI, the tracker and the workflow.
Operator pages, forms, lists, the design system.
Deployment, configuration, migrations, workflows, instance settings.
The test stack, screens, lint, walkthroughs.
Closed because another issue already covers it.
Small, self-contained, and explained enough to be a first contribution.
Closed because it is not a ticket for this repository.
Touches what a person's data reveals.
Touches authentication, authorization, secrets or data exposure.
Waits on another repository or project before it can move.
Closed because it will not be done, with the reason in the last comment.
kind
bug
The software does something other than what it promises; closed when it again does what it promises.
kind
debt
Code, tests or tooling to clean up with nothing visible changing; closed when they are cleaner.
kind
design
A question to settle before work can be defined; closed when the decision is written down.
kind
docs
Documentation that is wrong or missing; closed when it says the right thing.
kind
enhancement
Something the software does not do yet; closed when it does.
priority
critical
Blocks the active milestone or harms members now.
priority
high
Next in line inside the active milestone.
priority
low
Inside the active milestone, when nothing else is left.
priority
medium
Inside the active milestone, after the high ones.
Milestone
No items
No Milestone
Public launch
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: wiki-cafe/member-console#293
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What happens
The Billing page's Period column and the invoice page show each invoice's
period_startandperiod_endas Stripe sends them on the invoice. For a subscription invoice that is not the service period: a purchase's invoice reads "Oct 29, 2026 – Oct 29, 2026" for a month that runs to Nov 29, a mid-period upgrade's invoice spans the minutes between two changes, and Stripe documents that a renewal's invoice period looks back one period. The period each line pays for is on the invoice's lines, which the console already stores. The demo does not show it, because its seeded invoices carry full-month periods.What should happen
An invoice shows the period its lines pay for.
Where
formatInvoicePeriodand its two callers,internal/server/member_invoices.go; the invoice period stored ininternal/integrations/stripe/workflows/invoice_reconcile.goWhy it matters
Every invoice a member pays shows a period that is not the one they paid for.
The member's Billing page, the member's invoice page and the operator's invoice page now show the period an invoice's lines pay for. Until now they showed the period Stripe sets on the invoice itself, which Stripe defines as the span in which the invoice's items were added and which looks back one period on a subscription invoice: a purchase's began and ended on the day of the purchase, and a renewal's was the month that had just ended. Each line of an invoice carries the service period it bills, and the console already stores the lines it reads back from Stripe. An invoice's period now runs from the earliest start to the latest end of its stored lines, leaving out credits (a negative line, such as the unused time an upgrade returns, which the invoice does not pay for), a line of zero beside a charge (such as the credit of an upgrade from a $0 price) and lines whose period is a single moment (an invoice item given no period of its own); an invoice whose lines are all zero, such as one for a free price, shows their period. A monthly plan bought on Oct 29, 2026 reads "Oct 29, 2026 – Nov 29, 2026", and an upgrade to a yearly price reads the year that starts at the upgrade. An invoice with no such line, such as one whose lines all use prices the console did not create, shows "—", the console's mark for a value it does not have. If the lines cannot be read, the invoice pages show that mark too, and the Billing page shows its load error, rather than a period worked out from nothing. The pages compute the period each time they are read, so every invoice already stored shows it, with no migration. The console still stores Stripe's own invoice period and shows it nowhere. The demo database's invoices now carry Stripe's invoice period beside their lines, as a real deployment's do. Tests check the rule case by case and the period on each of the three pages.
Commit:
c7741fa5