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

    Function composeTotal

    • Fold every component into ONE authoritative total: subtotal − discount + shipping + tax, each a non-negative whole cent and the discount never exceeding the subtotal. The single place the order total is composed once shipping (a ShippingOption) and tax (a TaxResult) are resolved — so the cart drawer, checkout summary, order record, and the Stripe charge can never disagree.

      Parameters

      • parts: {
            subtotalCents: number;
            discountCents?: number;
            shippingCents?: number;
            taxCents?: number;
        }

      Returns OrderTotalFull