The law was intended to encourage credit card payments, because the paper trail makes it more difficult for merchants to under-report their tax obligations. (And the card companies lobbied hard, of course.)
In practice, merchants have found workarounds, such as offering more loyalty points for cash payments. Some of these workarounds are legal, some are not, but in any case the government is changing its stance on credit card payments due to soaring consumer debt. Now they're trying to encourage debit card payments . . .