If you present your credit card and the merchant won't accept it unless you produce photo identification, that merchant is breaking Mastercard and Visa rules. You should report such merchants to your card issuer:
This form (MasterCard site) lets you report a merchant who refused to accept your MasterCard for invalid reasons:
In order to make a MasterCard purchase, the merchant/retailer required a minimum or maximum amount.
The merchant/retailer is adding a charge for using your MasterCard card.
The merchant/retailer required identification.
A merchant/retailer displaying the MasterCard decal in their window refused to accept my MasterCard card.
From the Rules for Visa Merchants (VISA Site; PDF)
Q: * When should you ask a cardholder for an official government ID? Although Visa rules do not preclude merchants from asking for cardholder ID, merchants cannot make an ID a condition of acceptance. * Therefore, merchants cannot refuse to complete a purchase transaction because a cardholder refuses to provide ID. Visa believes merchants should not ask for ID as part of their regular card acceptance procedures. Laws in several states also make it illegal for merchants to write a cardholder’s personal information, such as an address or phone number, on a sales receipt...
According to the Visa FAQ, if you have been denied use of your VISA card for any invalid reason, or if you suspect any other type of merchant fraud, contact your card issuer. The issuer's name and telephone number is printed on your card.