Federal law makes it illegal to do a "straw purchase," meaning acting as a purchasing agent for another person. This is what he may have been thinking.
In the future, you may want to state clearly "I'm buy this gun for myself to give as a gift." This is legal and won't run you or the store afoul of the law as long as you have no reason to believe the person you're giving it to isn't barred from having guns.
I was at Bull's Eye yesterday and there was a couple shooting a pink P22. Neat gun.