The Second Circuit had viewed NY's law as only governing conduct, but the Supreme Court said that was wrong. There's a speech angle:
Writing for the majority, Chief Justice John Roberts said the New York law is “not like a typical price regulation,” because it doesn’t tell merchants what they can charge but rather how they choose to communicate their prices to consumers.
"They also want to make clear that they are not the bad guys—that the credit card companies, not the merchants, are responsible for the higher prices," Roberts wrote. "The merchants believe that surcharges for credit are more effective than discounts for cash in accomplishing these goals."