FA-59488 / Subscription proration billing / Member archive
Cancellation refund for unused days: refund rounding direction · case 03
Refunds sometimes exceed the exact unused value by a cent.
Case contract
Input {price, setup, period_days, used_days, min_days, mode immediate|period_end}. Unused = max(0, period_days - used_days). period_end: no refund, access continues for the unused days. immediate: charged days = max(used_days, min_days); refund = price*max(0, period_days - charged)/period_days floored (never over-refund); the setup fee is never refunded; access ends. Return [refund, access_days].
Why this case matters
Refund math must respect minimum-charge terms and exclude non-refundable fees.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [18359, 0] | [18358, 0] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗