In Spain, anytime you pay for something by credit card you have to show ID. This is by law apparently. Of course, most people here don't really care about the law, so pretty much anything with your picture on it will do. (I never take my passport with me... which legally I'm supposed to, but whatever). I usually just show my American drivers license. Once every two month or so I get a speech from the cashier about how it's not acceptable ID, blah blah blah.
So I just say that I'm new here and that I promise to bring it next time and then they usually let it slide. Remember, here in Spain, not following the exact letter of the law is ok (as long as you don't get caught). Not following the social norms is definitely NOT ok. The secret is that you have to look appropriately shamed by your transgression (everyone normally has their DNI, National ID Card with them), then you can usually get away with it.