I founds three possible solutions others have used in the Apple support forum. I don't guarantee they will work however it's better than nothing. Here they are:
googled the 5002 error- recommendation was to go to itunes prefs, store tab, and change buy from "1-click" to "shopping cart" option. worked on the windows version; haven't tried on the macs yet.
the trick with the shopping cart worked for me (windows) but you have to use the "buy now" button at the bottom of the window. If you use the buy button next to your item in the shopping cart you will get the same error.
I ran into this problem and was able to solve it by doing the following:
1. Sign out of iTunes (click on button with account name and then click Sign Out)
2. Click the Sign In button
3. Enter your username and password
Now, for me, it said that my billing information had changed outside of iTunes and I needed to update it. I did this and was able to purchase music after that.