It's not illegal, it's simply a matter of their contract with their credit card processor. If you want to take credit cards, you have to agree to Visa/MC/Amex's terms, and that includes no minimum amount, no discounts for cash, no surcharge for credit.

Matthew