Order fixed price projects, especially at the beginning. Big projects should be divided into smaller tasks with separate orders. You should build quite detailed specifications.
Take care for realistic cost and time estimations. If you hear 'no problem', expect problems.
Use milestones and supervise the project success. You should have an 'in-house' project manager. He should take care of the project and do the communications.
You should clarify the acceptance procedures and communicate them to your partner. Declare separate acceptance for self-contained
components or phases of deliverables (acceptance in part). User 'points of break-off' for any acceptance (what means, you are able to stop the order).
Don't pay in advance. Pay after acceptance or parts. Don't pay until you've got the compilable and documented source code.
Assure your property rights. Make clear, that all rights of the source code are reserved by you and that you prohibit the use unless you
expressly allow it.