public static function discountIsValid($code)
    {
        $discount = Discount_Shortcuts_GetDiscountByCodeOrNull($code);
        if ($discount == null)
            return false;
        $engine = Discount_Shortcuts_GetEngineOrNull($discount->get_type());
        if ($engine == null)
            return false;
        return $engine->isValid($discount);
    }