A trader counts money at Azadpur Mandi, one of Asia’s largest wholesale markets for fruits and vegetables, in New Delhi. (Altaf Qadri/Associated Press)

After India’s surprise decision to scrap high-value currency last month triggered widespread cash shortages, people in the large village cluster of Patoda got by as best they could. They postponed family weddings, asked for credit and bartered services.

But as the money crunch extended into its second month, officials from the State Bank of India arrived with a rescue plan of sorts, which included new card swipe machines for small businesses.

At Raj Purohit’s sweet store one recent afternoon, curious onlookers gathered around one of the unfamiliar machines, which he had painted with a stripe of auspicious red vermilion powder.

“Don’t waste time standing in bank lines. Don’t carry cash everywhere like you used to,” Purohit told those around him.

One customer said he didn’t understand how swiping worked. Another said he wouldn’t trust it. Purohit tried five times to swipe a young customer’s debit card. By the time it went through, everybody knew the secret personal identification number.

But the government isn’t giving up.

Even as banks scramble to replace bills for angry people in long lines, officials say the crisis is an opportunity to bring a grand cultural shift in Asia’s third-largest economy and move citizens toward cashless transactions involving cards, e-wallets and digital payment banks.

When Prime Minister Narendra Modi announced the removal of 80 percent of the currency from circulation last month, he called it a decisive strike against corruption and counterfeiting. But he also has exhorted citizens to take advantage of the change. He asked India’s younger generation to teach their parents, neighbors and even the corner vegetable vendor how to go cash-free.

“You have a leadership role to play in taking India toward an increasingly digital economy,” he told them.

It will be a long road. Nearly 80 percent of Indian transactions are conducted with cash. Tax-evading Indians typically hide their undisclosed wealth in cash, real estate, jewelry or in tax havens abroad. Undisclosed wealth, called black money here, accounts for over a fifth of the national output, according to estimates.

But Modi’s ambitious decision to replace bills worth more than $207 billion was derailed by shoddy implementation and slow printing of replacement bills, leaving Indians of all income levels without cash overnight.

Amartya Sen, a Harvard University economist and Nobel laureate, called it a “despotic action.” Former prime minister Manmohan Singh, an economist, said the move can have “ripple effects” on economic growth and job creation in the coming months. As the chaos continued, Goldman Sachs downgraded its outlook for India’s growth in the coming year — twice. The estimate now stands at 6.3 percent.

Officials say the switch-over will make it easier for the government to track transactions and boost tax revenue. The government announced a series of incentives for people making online payments last week, and ordered banks to install 1 million new swipe machines across India by March — up from 1.4 million today.

“What I had expected would have taken three to six years will now take three to six months,” said Nandan Nilekani, the tech czar who created India’s biometric-based identity program. One billion people in the country now have unique biometric identification numbers, more than 1 billion have cellphones and at least half a billion have bank accounts, he noted, which will help the transition.

But India’s digital infrastructure is not ready to carry a billion people yet.

Even though electronic bank transfers grew fivefold in the past five years, 73 percent of Indians have no access to the Internet. Mobile-phone banking transactions have tripled since 2012, but only 15 percent of phones have broadband, and speeds are slower than they are in Bangladesh, Sri Lanka and China, reported India Spend, a data website.

A panel of government-appointed experts recommended major changes last week to ease digital payments, including updated regulations, cash refunds and other incentives to spur change.

“Digital payment is disruptive, with tech start-ups moving many times faster than mammoth banks. The current regulations, anchored in the brick-and-mortar era, need to catch up,” said Prasanto K. Roy, a senior member of Nasscom, a technology trade body that was part of the panel.

“The government has to convince people who are deeply entrenched in and comfortable with cash about the benefits of making digital transactions,” Roy said.

The government just launched a TV channel to train Indians to make cashless payments and will soon open a toll-free helpline.

Downloads of digital payment applications have increased exponentially since the government’s move.

“When you take the air out of the system, something has to hold the economy together. Digital payment systems will help India leapfrog into a first world-like economy,” said Vijay Shekhar Sharma, the founder of India’s largest mobile wallet company, Paytm, which is reporting 6.5 million transactions daily, a major increase since Nov. 8.

But for now, the cash crunch continues to take a toll.

Manufacturing has slowed, car sales have declined and malls are reporting less traffic. Tourists are struggling to obtain new currency when they arrive. International tennis players Roger Federer and Serena Williams recently canceled tournament appearances in India because of the “prevailing economic climate.”

In Patoda, many farmers have piles of unsold cotton and soybeans. And in many villages, the wages of desperate laborers have been cut in half.

Last week, the State Bank of India held a training session for about 300 college students in Patoda to change their payment behavior.

“Your mobile e-wallet app is just like hard cash in your purse,” Suresh Gulve, a regional manager of the bank, told the students. “You can buy train and bus tickets, pay your bills and send money to relatives.”

But only one-third of the teenagers had smartphones. And even they could not easily download the app because the network was weak at their school.

Many traders at the weekly village market said that going cashless is not a realistic option for them.

“I sit in a different village market every day. I sell fish on the street. Swipe machines are not for people like me,” said Momin Shafiq, 38, at the decades-old market. He uses a basic cellphone and is functionally illiterate.

But the word is spreading slowly. A dozen store owners asked the bank for new swipe machines last week.

“We have no choice. Either we face business loss or adapt,” said Satish Vikram Garge, 28, who runs a kitchen store. “We have to move with the times, if India has to become modern.”