THEY CAN ASK,BUT YOU CAN REFUSE & MASTERCARD & VISA HAVE RULES THAT PROHIBIT A MERCHANT FROM REQUIRING IT,AS LONG AS THE CARD IS SIGNED:
" MasterCard and Visa,
however, explicitly prohibit retailers from requiring
an ID to accept a properly signed card. "They can ask
for that ID, but you can refuse to show the ID and
they still must accept the card," says Paul Stephens,
director of policy and advocacy at the Privacy Rights
..That law andothers like it don't prohibit merchants
from checking IDs. But "the minute you record that
information, either by writing it down or entering it
into an electronic system, at that point you most
likely have broken the law," Stephens says..."
http://www.creditcards.com/credit-card-news/can-retailers-ask-id-with-credit_card-1282.php