As more stores and restaurants get rid of their cash registers in favor of a card-only policy, there’s been pushback from some lawmakers who say not accepting cash is a form of discrimination.

Philadelphia is the latest community to reject card-only policies, with the City Council passing legislation earlier this month to ban the practice. Mayor Jim Kenney has 30 days to decide whether to sign or veto the legislation, which would require all cashless brick-and-mortar stores to comply by July 1. The New Jersey State Legislature has also passed legislation that would require stores to accept cash, and similar proposals have been discussed in Washington, D.C., and New York City. Massachusetts law requires all stores to accept cash and credit.

Sweetgreen, a national salad chain, is one of many companies operating a cashless service in Philadelphia.

“It seems unfair to me that I can walk into Sweetgreen, get a salad, but the person behind me that has the monetary unit the United States of America has used for centuries can’t get that same product,” Philadelphia City Councilman Bill Greenlee said. “That’s not intentional, but it is discrimination.”

While cash and coins are legal tender for all debts, there is no federal law that requires businesses to accept them in exchange for goods and services, according to the Federal Reserve’s website.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Lawmakers supporting a cashless ban say the practice is unfair to people who don’t have a bank account or credit card. There were 8.4 million unbanked households in the United States in 2017, according to the most recent survey data available from the Federal Deposit Insurance Corp. An additional 24.2 million households were underbanked, which the FDIC defines as having a checking or savings account, while also getting financial products and services outside of the banking system, such as payday loans or pawn shop loans, at least once a year.

Cash is also appealing to privacy-conscious consumers who want to make purchases without sharing their data or worrying about whether their credit card information could be jeopardized in a data breach.

“One thing that’s true in payments is that it costs money to move money. Who pays that cost is the question,” said Dave Stearns, a senior software engineer at Adobe who has written extensively on the shift toward electronic payments.

Many cashless stores say the move to plastic allows them to serve customers more efficiently and cuts out the time and administration that comes with counting cash and depositing it every day. Another argument is that it makes the stores less attractive targets for would-be thieves looking to empty a cash register.

In Philadelphia, Sweetgreen restaurants and Bluestone Lane coffee shops are among the spots that don’t accept cash. Amazon Go, a chain of grab-and-go stores where no cash changes hands, has locations in Washington, California and Illinois. Many other national chains are also experimenting with the concept.

Mike Dunn, senior deputy communications manager for the city of Philadelphia, told NBC News the mayor’s office is concerned about the number of Philadelphia families who do not have access to bank accounts, but it is still reviewing the legislation to determine the best approach.

“That said, we remain concerned about how this measure impacts innovation in our retail sector. We constantly seek to strike the balance of growing our economy while ensuring our growth is inclusive. This issue is at the heart of that challenge,” Dunn told NBC News.

Greenlee said he believes asking businesses to accept cash isn't a hardship, since they've been taking cash since before the rise of digital payments.

“The rights of the customer should be the main factor. It gets down to fairness,” he said. “We’re not asking businesses to do something that hasn’t been done for centuries, which is taking cash. That’s what businesses have always done.”