I was going to look it up. It was O. Henry
I read it in grade school, and mistakenly believed it was Mark Twain’s story. But he was really part of a whole literary movement, and Brett Hart and O. Henry were part of it, too, so he influenced them and they influenced him. So it’s easy to confuse them.