
Why Partial Refunds Overpay by 1 Cent: Fixing Discount Allocation in Java E-commerce Systems
This article explains how naive discount splitting causes rounding errors that make partial refunds exceed the original payment, and demonstrates a robust solution using the largest remainder method, per-unit order amount snapshots, and idempotent refund reservation to ensure financial consistency in Java e-commerce systems.