It's a little cruel to take something that was free, and cage them. They may become stressed and could get sick or die.
I would purchase ones that were bred for life in a tank.
I have fancy goldfish, and they jump out of the tank and pop bubbles. Sometimes it keeps me up. My comet goldfish even picks up rocks in his mouth and swims fast at the front of the tank, throwing them at the glass. Its ridiculous.