There is no level involved at all, and you had it right the first time: it is the trade that does it.
Haunter evolves into Gengar the instant the trade completes. No levelling, no waiting, no special item. The moment the exchange goes through, the evolution happens.
The one exception is an Everstone, which prevents evolution. What exactly happens if a Haunter holding an Everstone is traded is less clear, so treat that as an edge case rather than a strategy.