NEW YORK (AP) — New York City lawmakers voted Thursday to require stores and restaurants to accept cash for payment, saying businesses that accept only credit and debit cards are discriminating against New Yorkers who lack bank accounts and credit cards.

“This practice punishes the underbanked,” City Council Speaker Corey Johnson said before the council’s 43-3 vote in favor of the bill.

Under the bill, businesses that refuse cash will be fined $1,000 for the first violation and $1,500 after that. The measure, which is expected to go into effect by the end of the year, also prohibits stores from charging higher prices for paying in cash.

Democratic Mayor Bill de Blasio is expected to sign the legislation. A spokeswoman for the mayor said that he supports the intent of the bill but that his administration will review it.

Backers of the cashless model say the benefits include greater efficiency and eliminating the risk of theft, but opponents say millions of Americans still rely on cash.

In adopting the ban on cashless businesses, New York City joins a growing backlash against the digital-only economy.

Philadelphia became the first U.S. city to ban cashless stores last year, despite opposition by retail giant Amazon. San Francisco and New Jersey passed similar measures soon after. Only one jurisdiction required businesses to accept cash before 2019: Massachusetts, which passed a law nearly 40 years ago.

Backers of the New York City bill said that hundreds of thousands of city residents don’t have bank accounts or credit cards and that others simply prefer to use cash.

“Whatever your reasons, consumers should have the power to choose their preferred method of payment,” City Councilman Ritchie Torres, the Bronx Democrat who sponsored the legislation, said before the council’s 43-3 vote in favor of the bill.

Councilman Kalman Yeger, a Brooklyn Democrat, said that businesses should accept cash but that the local government shouldn’t force them to.

“We’re inserting ourselves into the business of business in a way that we don’t have a right to do in my opinion,” he said in explaining his “no” vote.

But some businesses that will be affected by the no-cash ban said they will follow the law when it is enacted.

“We are proud to do business in NYC and will of course comply with all NYC laws and statutes,” Nick Marsh, CEO of Founders Table, parent company of the Chopt Creative Salad Co. and Dos Toros Taqueria chains, said in a statement.

A company spokeswoman said six of New York City’s 18 Chopt locations and all of its 17 Dos Toros locations are currently cashless.

Mary LeSage, waiting to buy lunch at a Chopt counter in Manhattan earlier Thursday, said the cashless policy is efficient but she agrees that it might be discriminatory.

“It’s an ease of use sort of thing, to make it go faster,” LeSage said. “I’ve seen this line go all the way around there. But on the other hand, I do think it’s wrong to bar people from food because they don’t have the necessary resources. If it takes me five minutes longer to get lunch, that’s fine if it means everyone can get food.”