Seat-change preview: price the change before anything is billed #15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/seats-preview"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Dogfood finding from Nikola: the one-click seat change billed the saved payment method instantly with no review — correct Paddle behaviour, wrong customer experience, and easy to trigger accidentally.
New
POST /v1/licenses/{id}/seats/previewcalls Paddle's subscription-update preview (PATCH /subscriptions/{id}/preview) with the identical body the real change would send — same items, same proration mode — so the price shown is exactly the price charged. ReturnschargeNow(action charge/credit, amount in minor units, currency),recurringTotal/recurringCurrency, andnextBilledAt. Nothing is committed or billed by a preview.Shared validation (session, org-admin, ownership, unrevoked, subscription-backed) extracted into
resolveSeatChange; item-body construction intosubItemsBody— both endpoints stay behaviourally identical on the guard rails, proven by the test running the same 401/403/404/409 matrix against both.The test fakes both Paddle paths and asserts the crucial property directly: after a preview, the real subscription PATCH count is zero; after confirm, exactly one, with quantity 65 and
prorated_immediately.