I've read that some stores will not take the card back and offer a refund because of rampant scamming. Email Apple and see if they will credit your account. Good luck.
Did you enter the code in all caps? You would think it wouldn't matter these days, but with iTunes cards it does and many a time they haven't worked for me and that was why.
I know this may sound weird but I had the same problem when I would enter the code and hit the enter key. Are you doing that or clicking the enter/redeem button?