30-50% up front, unless it's an established customer with you. Minimum 10-20% up front if it's an established customer with someone else. Code demo on your server, full payment, delivery of code. Clear written agreement on project scope and situations that demand work beyond the scope. Can't go too wrong.