The California Attorney General Webpage states:

In 1985, California passed a law that prohibits merchants from adding a surcharge (an extra fee) when customers pay by credit card instead of cash. That law does allow merchants to give customers discounts for paying by cash, check, or debit card, as long as that discount is offered to all customers. In March 2015, however, a federal court declared that law unconstitutional and prohibited the Office of the Attorney General from enforcing it.

Visa/MasterCard Settlement Act

Allowing Merchants to pass fees on to customers (Surcharging) Some States Limit Surcharging

Cash Discounts as a Tool

-Fee must be charged on ALL transactions equally

-Discount can be given on certain forms of payment