mirror of
https://github.com/hanzoai/commerce.git
synced 2026-10-30 15:08:42 +00:00
The subscriptions view gains Seats, ChargedCents and PendingQuantity. Seats and ChargedCents come from the period's paid invoice (its plan line's quantity, and its plan fee after discount less what was refunded) or from the seats and price now recorded with an external period, never from the row's quantity; a period recorded without them reads the row's seats at the plan's price. Invoices record refunds by id and a dispute's state. A payment that paid an invoice is indexed to it (models/paymentorg), so the processor's refund or dispute marks that invoice instead of drawing on a wallet; a refund recorded through the refunds API counts the same way and never exceeds what the invoice still holds. A period refunded in full or disputed, open or lost, reads unpaid; a dispute won restores it. PATCH quantity sets the row's pending quantity; the renewal invoices it and the row holds it from then, and an external plan takes it with the next recorded period. Members never exceed the seats paid for now. Co-authored-by: Hanzo Dev <[email protected]>