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

    Interface Discount

    A discount's MATH shape (the structural part; app-side eligibility rules are separate).

    interface Discount {
        type: "percent" | "fixed";
        value: number;
        minSubtotalCents?: number;
        maxDiscountCents?: number;
    }
    Index

    Properties

    type: "percent" | "fixed"
    value: number

    percent: 0–100; fixed: cents off the subtotal.

    minSubtotalCents?: number

    the discount only applies at/above this subtotal (cents).

    maxDiscountCents?: number

    cap the amount removed (cents) — e.g. "30% off, up to $50". Applied before the [0, subtotal] clamp.