@suluk/payments - v0.1.0
    Preparing search index...

    Function prorateDiscount

    • Split discountCents across lines proportionally to each line's total, as whole cents that sum EXACTLY to discountCents (largest-remainder apportionment). This is what keeps the cart drawer and the order summary from disagreeing by a cent. Each line's share is clamped to its own total.

      Parameters

      Returns number[]