basalt / subscriptions/src / couponDiscount
Function: couponDiscount()
> couponDiscount(coupon, subtotalMinor, currency): number
Defined in: subscriptions/src/coupon.ts:99
The discount (minor units) a coupon yields on a subtotal, clamped to [0, subtotal]. A fixed-amount coupon in a different currency yields 0.
Parameters
coupon
subtotalMinor
number
currency
string
Returns
number