There are four actions: wrapping, paying, putting on a smile, and speaking.
Having paid for the newly wrapped present, she put on her brightest smile,
and said “Thank you, Sam. Goodnight.”
(perfect aspect)
What happened? First wrapping, then paying, after that smiling, and finally speaking.
After the present was wrapped, she paid, put on her brightest smile,
and said “Thank you, Sam. Goodnight.”
(passive in the prepositional phrase; sequence in the past)
What happened? First wrapping, then paying, after that smiling, and finally speaking.
After the present had been wrapped, she paid, put on her brightest
smile, and said “Thank you, Sam. Goodnight."
(passive in the prepositional phrase; past perfect)
Same order of events.
And when it was all wrapped and she had paid, she put on her brightest
smile and said “Thank you, Sam. Goodnight.”
Stop. When... she had paid? It's ambiguous. We do not know the order of wrapping and paying. The simple past perfect is used to indicate the past of the past. This sentence goes in two directions: logically, wrapping happened first. But the grammar of the clause tells us that paying happened first.
This sentence makes sense:
When she had paid, she put on her brightest smile and said “Thank
you, Sam. Goodnight.”
It means that she did the action of paying and went on to do something else.
We use the past perfect to describe an action before a past time. So, the only way to make sense of the sentence in question is to say that paying happened before wrapping, almost as an afterthought of the author. It is a mess.
And when it was all wrapped and she had paid, she put on her brightest smile and said “Thank you, Sam. Goodnight.”
If you do not think it is a mess, consider this:
And when it was all wrapped and she had already paid, she put on her brightest smile and said “Thank you, Sam. Goodnight.”
Now we are in her head, a confusing place to be. Ah, perhaps this is intentional!
The Answer to Your Question
No, your two sentences do not necessarily have the same meaning because we cannot establish the meaning of the first sentence. We have a bit of Virginia Woolf action going on here, and that is not necessarily a bad thing at all.