Bug: mid-cycle seat upgrade extends license expiry by a full period #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
refresh()(main.go) always pushes expiry one period past max(now, current expiry). Correct for renewals — its original purpose (#3) — but everytransaction.completedcarrying a knownsubscription_idgoes through the same path, including the prorated transaction Paddle emits when a subscription's quantity is changed mid-cycle.Consequence on a yearly license: customer six months in upgrades 55→65 seats, pays only the prorated difference, and gets expiry pushed to old-expiry +1 year (+3 days). If they then cancel, they keep a valid 65-seat license for up to ~18 months having paid for 12 plus a proration.
Fix: distinguish transaction origin. Paddle sets
origin: "subscription_recurring"on renewals andorigin: "subscription_update"on mid-cycle changes. Onsubscription_update: update seats and re-sign the same license id without touching expiry. On renewals: current behaviour. Needs a test proving an upgrade leavesExpiresAtunchanged while seats move.