After a man was fired from Walmart in a dispute over empty cans and bottles, an online fundraising campaign set up for him has attracted more than $20,000 in pledges.

Thomas Smith was just glad to have a job. As an ex-convict who spent some time living on the streets around East Greenbush, about two and a half hours north of New York City, he said it was "the biggest relief" when a local branch of retail giant Walmart hired him to fetch shopping trollies from the store car park.

But trouble began one recent day when Smith, 52, cashed in a pile of empty cans and bottles. New York is one of 10 US states which has a container deposit law. When buying drinks in aluminium or glass containers, a small deposit - in New York, $0.05 - is added onto the price. The customer, or whoever happens to come upon a discarded can, can take it back to a shop and receive the deposit back.

Smith says he found the empty containers in a trolley while he was going about his work, and that he cashed them in for $5.10 (just over £3). But Walmart says he had taken the empty containers from inside the store after other customers had already redeemed the deposit on them, and that he was essentially trying to cheat the system. They sacked him.

"I didn't know I was stealing anything," Smith says. "I'm just trying to do the right thing out here, not go to prison."

Smith is concerned about how the incident will affect his ability to find another job, particularly in light of his previous convictions. "I feel hurt. They've labelled me a thief. It's stripped me of everything," he says.

In a statement, Walmart said: "This is an unfortunate and complex situation. We believe in providing people with opportunities. We also value honesty and set high expectations for our [employees] in order to best serve our customers. In this particular case, we gave Mr Smith that opportunity and due to this incident, as well as the fact he did not disclose certain serious criminal convictions during the application process, we will not reinstate him."

'Soft spot'

Smith denies Walmart's claims that he misled the company during the application process and says that he disclosed all of his prior convictions. His story appeared on Instagram, where it was noticed by Dounya Hamdan, a 26-year-old who works at an accounting firm in Chicago. Hamdan set up a GoFundMe page for Smith on 19 November.

"I have a soft spot for people like Thomas," she wrote. "I am a firm believer of second chances."

After two hours, Hamdan told BBC Trending, the campaign had only collected $15 towards its $5,000 goal, but overnight donations exploded into the thousands - and more than $20,000 has now been donated to the fund.

Smith's story has also been noticed locally. Alice Green, executive director of the Center for Law and Justice in nearby Albany, says the group is spearheading a local petition demanding an apology from Walmart, financial compensation, and a new job at another location. They are also working to find legal representation for Smith, and asking local residents to boycott the shop for the holiday season.

However, Walmart spokesperson Aaron Mullins told Trending that the company stands by its decision to fire Smith and that it was unlikely Smith would be re-employed in another store.

Meanwhile, Smith is looking for another job, and hoping to get a driver's licence to increase his prospects.

"I'm going to do the right thing with the money, be really careful. Obviously I have bills to pay, but I'll take it slow," he says. "I just thank all the people who've supported me."

Blog by Olivia Lace-Evans

Next story: Citizen journalists capture life in Raqqa under Islamic State

The citizen journalists behind Raqqa Is Being Slaughtered Silently (RBSS) are the main - and often only - source of information about life in a city controlled by the so-called Islamic State.READ MORE

You can follow BBC Trending on Twitter @BBCtrending, and find us on Facebook. All our stories are at bbc.com/trending.