"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 snapped and shared on Twitter by a passer-by called Luke.
"This guy at Wyoming Coles who just went through the register with his two kids paid for this lady's groceries when her card kept declining," the tweet read.
In an additional tweet, Luke continued by saying although the lady wanted to pay him back the father-of-two refused.
"She wanted to pay him back eventually and he just said, 'Don't worry, have a good day.'"
The image has been met with praise on Twitter, with social media users calling the Good Samaritan an "absolute champion" and an "awesome guy".
Mr O'Donnell, who is a stay-at-home dad with a young girl and boy, said the response to his good gesture was "overwhelming."
"The lady wanted to know how she was going to get the money back to me," he said.
"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 brought myself a coffee from Gloria Jeans."
Mr O'Donnell said he could tell "the old duck was getting confused" and she reminded him of his nan.
"I couldn't not walk away," he said.
"That's how my mum and dad brought me up."
Mr O'Donnell's good deed was met with praise on social media, with the post of the pair being retweeted more than 145 times, and more than 460 likes.
"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 Twitter user wrote.
"What a nice person! Humans are the best," another added.
Another social media user, Julie Boyd, said she had done a similar deed for another person while having trouble paying at the checkout.
"I did that yesterday. Poor old bloke was distraught he couldn't get his card to work. Have to look after the oldies," she commented.