This article is from the Credit cards and Consumer Credit FAQ, by firstname.lastname@example.org (Steve Adams) with numerous contributions by others.
In a word, maybe. In a few more words, probably, if the merchant
goes about it the right way.
The Federal Truth-in-Lending Act prohibited surcharges on credit-
card purchases until 1984; since then, there has been no Federal law
on that subject. (Other provisions of the law are still in force.)
The states of CA, CO, CT, FL, KS, MA, ME, NY, OK, and TX have laws
against surcharges, according to Bankcard Holders of America.
Discover allows surcharges on credit-card purchases, except in the
above states. Visa and MasterCard prohibit them. American Express
discourages them in general, and specifically prohibits them by
merchants that also take MasterCard or Visa because Amex doesn't
allow merchants to discriminate against it.
There is a loophole: merchants are allowed to give cash discounts.
This means in practice that they can't charge you more than the
labeled price if you pay by credit card, but they can charge you
less if you pay cash. Some companies announce (usually in tiny
print in the catalog) that all prices "reflect cash discount" of x%
so credit-card users must pay x% more than the stated price; this
may be legal but it certainly violates the spirit of the law or the
regulations. I don't know about the "service fee" charged credit-
card users for things like ordering tickets over the phone, but
they're certainly not allowed to charge you a higher price in person
than if you pay cash.
The other loophole, according to Bankcard Holders of America (BHA),
is this. Certain government agencies are by law not allowed to pay
"discount fees," which are the processing fee the bank charges
merchants for handling credit-card slips. Since the banks won't
handle these for free, if your state lets you pay license fees by
credit card you may well have to pay a surcharge for the privilege.
However, BHA says that there are no exceptions for retail merchants.