As I recall, the pay due must be paid, also for the mercs to restock and recruit new members to replace the fallen. I'd imagine the entire merc company rarely takes the field, their supports, offices and whatnot remains even if all soldiers in arms fall.
I expect that you pay a chunk up-front, make ongoing payments, with a sweep up at the end - any noble who welched would risk never hiring again - and on a big enough contract would risk the mercs a) selling all his secrets to his enemeis and b) offering a good deel to any neighbour who would help them 'collect the debt'.
On the other side, mercs who desert, are completely useless, etc will find their employer renegotiating, refusing to pay etc - no noble would completely surrender their power by paying everything up front. Quite likely the money is put in an escrow upfront, and then argued over later if one side underperforms. There are bound to be banks, etc in the Imperial City who could perform the escrow role, and business would be fairly constant justifying independent trusted brokers to oversee the escrow...