I agree with others - I didn't feel "tricked" the first time I read the story. In fact, I think O. Henry is asking us a serious question through his final paragraph of the tale - although some may laugh at Jim and Della, the author assures us that is they who have understood the original intention of the Magi the best - their self-sacrificial gift-giving reveals that they have understood what the tradition we have today of giving gifts is all about.
I agree that "The Gift of the Magi" is a somewhat predictable story, so to that extent the readers are prepared for the "surprise" ending. In fact, I might describe this ending as more of a "twist" than a surprise. It should leave readers satisfied rather than tricked in any way.
As I read it, I found it to be logical, a bit predictable even. At least for O. Henry, this wasn't one of his most surprising endings. The amount of time that he spent describing Della's love for Jim, how little money they had, how he treasured the watch and her hair...clues can be gathered throughout. It is one of O. Henry's simpler stories, and a sweet one at that.
When you read fiction, you need to add a pinch of 'fairy dust' to the original ingredients! Samuel Coleridge identified this as "the momentary willful suspension of disbelief." The reader must choose to get involved and taken up in the story line; he puts hard logic and reason temporarily aside.
Perhaps the ironic twist at the end of "The Gift of the Magi" isn't all that likely, but that is altogether its charm. If the reader had anticipated it, if he had not been caught off-guard so to speak, the tale wouldn't have been half so interesting. As the best and worst of life's surprises are the most memoriable, the message of the Magi is best transported by this element of surprise. Little does it matter if the events are probable; if the characters are believable - loathesome or endearing, if they move you emotionally, if the essential message is caught, then the story is a success.
The story is constructed to show the value Jim and Della placed upon each other and upon their respective prized possessions. The ending expresses how much they love each other, to forego each's respective prized possession in order to enhance Jim's watch and Della's hair. No trickery involved!! It's a love story!
I think that the conclusion of this story is completely logical albeit a little surprising. We know the circumstances through which Jim and Della are going through. They are finding it difficult to make both their ends meet with their meagre income. It is evident that they cannot afford valuable gifts each of them think the other deserves. Therefore, they sell their most prized possessions and bring a gift for the other which will adore the other's most prized possessions which are the hair for Della and the watch for Jim.