If it is at all possible, it is best to maintain enough control over the system so that you can deploy it to their production environment upon payment. No pay, no deploy.
Second this. I also request a 50% deposit before I begin work, and tend to price projects at a level where I won't be completely put out if they never complete the project.