Yes, you should get payment first. If upon receipt and inspection, buyer is not satisfied, he'll have to contact you to resolve the issue. If you agree, you can provide a refund and the FFL can return the pistol. SOMEONE is going to have to pay for shipping the firearm back to you.
Agreed with OF. Get your certified funds first if you don’t know the buyer. USPS is about the only thing as good as cash. Then send your gun to his licensed gun dealer for transfer once the funds are tucked away in your bank. If he refuses the gun and you’ve agreed before hand that he has the ability to return it, then have him send the gun back to you first and once you’ve inspected it and it’s in the same shape as when you sent it, then return his money.
I've always liked the idea of face to face. Saves a lot of hassle. If you get along with an owner of a gun store in your area, Ask to arrange the sale there. The buyer can inspect the firearm and get an opinion. And an FFL is on sight. If not ALWAYS get the money 1st.