Maryland motorists may have to begin paying for their gasoline in cash starting July 1 as a result of an interest-rate law signed this week by Gov. Harry Hughes.

Some finance companies already have decided to raise interest rates on small loans, and bank credit-card issuers in Maryland also may raise their interest rates because of the new legislation.

It prohibits oil companies from charging service stations processing fees for gas bought with credit cards and raises the maximum interest rate on all credit cards from 18 to 24 percent.

Texaco Inc. immediately announced that it will stop accepting its credit cards at Maryland stations. Mobil Corp. said it no longer will permit credit sales for diesel fuel and no longer will accept applications for new cards.

Exxon Corp. and Amoco Oil Co. were evaluating their positions yesterday to determine whether they will continue to permit card purchases in the state. Atlantic Richfield discontinued its credit cards earlier this year nationwide, saying the move will save it $46 million a year.

Reaction from service station managers differed. Ray Swartz of Wheaton Texaco predicted a "devastating effect. Doctors and lawyers need credit card receipts for tax purposes; they don't want to use bank cards and mix up their gas with other household purchases." Swartz said half of his credit card business will fall.

On the other hand, Carl Reed of Takoma Park Texaco remarked that curtailing credit will not affect business much. He said that he made his self-service island cash-only a long time ago and that few people have complained. "Most people are reasonable when I explain to them I'm paying 3 percent to Texaco so they can use their cards."

The law was changed to prevent oil companies from adding on processing fees that then are passed on virtually unbeknownst to the customer. according to Hughes' chief legislative officer, Carl Eastwick.

The cost of credit instead should be reflected in the finance charge that the customer pays on credit-card purchases. The new law will raise that charge from a current maximum of 18 percent to 24 percent on July 1.

This would seem to rule out in Maryland the discounts given in the District and Virginia for cash purchases, because this is an implied surcharge on credit card transactions.

Eastwick was vague about what other specific marketing practices the law would outlaw. "Some oil companies have problems with the law because they believe it will prohibit them from doing something they want to do," he said. Many of them opposed the bill from the start. Eastwick recognized three or four different plans under which the oil companies can recoup the cost of credit, but added that he could not say if any were illegal.

One common practice is for an oil company to pass on the credit-processing cost by upping the price of a tank wagon of gasoline sold to the service station. Amoco uses such a method to build in a 4 percent surcharge on the one-third of the tank that is sold on credit to the customer. Exxon, on the other hand, says it had a single wholesale price for each grade of gasoline.

Exxon, which has 100,000 card holders in the state, and Mobil, which has 126,000, are exploring options that would permit the continued use of credit cards but without revolving credit. By requiring a motorist to pay bills in full at the end of each month, an oil company could avoid a processing charge.

And, although the law raises the maximum interest rate ceiling on cards issued by banks to 24 percent on July 1, it is not yet clear if and when banks will raise their rates.