This paper considers contractual choice under imperfect legal systems, in particular, contracts with different timing of payment. Ex-ante payment contracts are risky for the buyer, because the seller may shirk. Ex-post payment contracts are risky for the seller, as the buyer may default. Optimal contract is solved for any given legal environment. Exchanges with lower gains from trade tend to adopt ex-post payment contracts. The seller is a better proposer than the buyer in terms of the efficiency of the proposed contract. Surprisingly, offering ex-ante payment contracts is not strictly better for the seller under any legal environment. Moreover, mixed payment contracts are also analyzed and shown to never be optimal.