THAT LITTLE FANDANGO last week involving gasoline station operators, credit cards and two federal agencies pointed up an anomaly in the Truth-in-Lending Act. That law forbids a gas station - or any other retailer - to charge customers extra if they pay by credit card. But it does not prevent them from giving a discount to customers who pay with cash.

The Department of Energy overlooked this distinction when it announced that gas stations are "not prohibited by the price rules from imposing a charge for honoring credit cards." But the Federal Trade Commission, ever vigilant about protecting consumers, did not. Within 24 hours, it warned gas stations that "credit surcharges" cannot be imposed.

While a surcharge for buying on credit (illegal) and a discount for paying cash (legal) have the same practical effect, Congress chose deliberately in 1974 to legislate this distinction.It wanted to protect credit customers from merchants who had loaded on heavy surcharges as a way to pick up additional money without calling it interest.

The congressional decision was reasonable, given the record of gross discrimination against credit customers. But the effect of that deceision - aided by the resistance of credit card companies to any "discount-for-cash" policy by retailers - has been to discriminate against cash customers and to inflate prices.

When credit and cash prices are the same - as they are in most businesses these days - the additional costs to merchants of doing credit business are included in those prices. That means each cash and credit customer pays the same share of costs that are incurred only in credit transactions. Since many credit card companies keep a percentage of all the money they collect, this markup is more than minimal. The credit card customer gets a little of this back because he doesn't have to pay the bill for a month or more. But the cash customer gets nothing. In the present system, it makes no sense for anyone to pay cash for anything that can be charged.

Isn't it time, then, for consumers to mount a "discount-for-cash" campaign? If successful, it would put a small dent in the cost of living and might slow down the accumulation of consumer debt, which has reached the staggering figure of $292 billion.

Credit cards are convenient and make it easy to buy things now and pay for them later. But the consumer who want to put up with the inconvenience, and the risks, of carrying cash deserves a break. The Department of Energy would have provided it with its ham-handed and illegal surcharge idea, even though its intent was to provide more income for gasoline retailers. Other retailers could do it on their own, if they wanted to, and if they kept their profit margins constant by making the discount equal to their costs of handling credit cards.