Usually it comes through closing. The title company or closing attorney holds the assignment agreement, the buyer wires their funds, and your fee is paid out of the settlement as a line item to you. Some wholesalers collect a non-refundable deposit from the buyer at the time of assignment, often a few hundred dollars up to a thousand, with the balance at closing. Getting the whole fee in cash directly from the buyer before closing is unusual and most buyers won't do it.
On visibility: yes, the assignment fee typically appears on the settlement statement, and whether the seller sees a statement showing it depends on the state and on how the closer prepares the documents. Some states use a single combined statement, some issue separate seller and buyer statements. This is a question for your closing attorney or title company in the state where the property sits, because practice differs.
The cleaner answer to the visibility problem is disclosure. Tell the seller in the contract that you may assign the agreement to another buyer for a fee. Sellers who understand they're selling to someone who'll pass it along rarely object at closing, and a seller who's surprised at the table is how deals die. Several states now require that disclosure in some form anyway.
Where the fee is large relative to the price, some operators use a double closing instead, buying and immediately reselling in two separate transactions so the seller never sees the resale price. That costs you a second set of closing costs and requires funding for the first purchase, even if only for a day. It's a tool for a specific problem, not the default.