Are you talking about street magic in the sense of just approaching people cold, asking them "Do you want to see something cool?" (or similar) and then performing to them? It is possible to get tips in this context, but not from everyone, hence suggestion 1:
1. Choose your target. This is a matter of empathy. If people allow you to perform for them, learn to gauge whether they're doing it out of politeness, awkwardness, pity or because they are genuinely interested in what you've got to show them. If, after your first trick, they aren't fully engaged by you, give up at that point as you aren't going to change their mind and they aren't going to give you any money.
2. Introduce the idea of a tip as a joke during your second trick. So maybe your second trick could involve borrowing some money and you could say, "Don't worry, you'll get it back...if you're the kind of person to take money off a poor, struggling artist, that is!", or something like that. Slightly laugh as you deliver the line so it's softened and doesn't come across as though you're actually begging, but it'll seed the idea of handing over money.
3. After your third trick, deliver your "hat line". Here's a variant of mine: "Now, although I love performing magic, this is actually how I make my living, and even magicians have to pay rent, unfortunately. So, if I show you one more thing, something that really amazes you, would that be worth a few [INSERT LOCAL CURRENCY]"? If they say no, then thank them for their time and appreciation and leave. In your mind, you have to believe that this last amazing thing you were going to show them is worth money, so don't give it away for free.
BONUS SUGGESTION: Get a part-time job at somewhere that does door-to-door sales. Latch onto the best-performing salesperson and learn everything you can from them. Salespeople who can turn up, uninvited, on someone's doorstep and make them buy something they didn't know they wanted are among the most talented persuaders you'll ever come across. Often, the reason they're not multi-millionaires is that they're unambitious or, frankly, lazy. People who've made a living at that game for a few years are a gold mine of knowledge and experience.
I used to use three hat lines. One near the beginning which was very short, one in the middle which was slightly longer, and then one right before the last trick which was a genuine, "Give me money" kind of thing. It worked for me.
I highly recommend anyone looking to do this kind of thing pick up Kozmo's "Tales from the Streets".