“I was just there in the grocery aisle or checkout with my kids and I saw the old lady having some trouble with the card," the 34-year-old said.

“She swiped it quite a number of times and then they took her around to the front cigarette counter and got her to keep trying.

"By that stage my groceries had gone through and I went around and spoke to the young lady and said ‘how much is it’ and they said $44 or something...her card kept being declined due to insufficient funds so I said ‘Look, here’s $50 just take it out of that’.”

The heartwarming moment was captured by fellow shopper Luke, who posted a photo to Twitter.

This guy at Wyoming Coles who just went through the register with his two kids paid for this ladies groceries when her card kept declining 👍 pic.twitter.com/pTLq0ij6NK

Mr O’Donnell said the lady had wished to pay him back and was concerned about how she was going to return the money.

“I said ‘Oh look, don’t worry about it — it’s only $44, you’ll be right and enjoy your day’. With that I walked off and I think I went and bought myself a coffee from Gloria Jeans,” he told Channel 9 News.

Social media users have praised the stay-at-home dad as a "legend", “good samaritan” and “awesome guy.”

"Absolute Champion. Should be more people like him in this world. If we all knew how to give, think of how amazing life would be?" one user wrote on Twitter.

Another wrote: "What a nice person! Humans at their best."

One user said: "The world, while seemingly drowning in paranoia and hate, just keeps giving. Thanks for sharing."

Mr O'Donnell said the public reaction to his random act of kindness was "overwhelming".