SF is like a open market when it comes to getting opiates if you are in the "bad neighborhood." You are pretty much going to get tar or mud. These days it is wrapped in plastic bags and not very often balloons. Anyway, I have not heard of people getting gaffled (ripped off) when getting "hop", "chiva", or black" in tar form. This is not the case with white (crack), not to be trusted.
Typically, people just mess with the size (i.e. try to pass a $10 for a $20 or 2 $20s for a gram).
Just to be sure you could open it, make sure the size is okay and not wrapped in 10 plastic bags, smell it or taste it, before paying. Don't let them rush you by saying it's hot and make it fast b/c cops are coming. Don't give your money first.
If you know no one at all. You could ask usually older, black men who are selling rigs for a dollar....before buying rigs.
If you don't like getting sick, ever consider getting on suboxone or something?