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

    Function verifyAmount

    • ANTI-TAMPERING: recompute the total from authoritative line prices + the discount and compare it to the amount the client claims (e.g. a PaymentIntent amount the browser posted). Reject any mismatch beyond toleranceCents (default 0 — money is exact). The server must call this before honoring any client-supplied amount.

      Parameters

      • lines: CartLine[]
      • discount: Discount | null | undefined
      • claimedCents: number
      • opts: { toleranceCents?: number } = {}

      Returns AmountVerdict