Trade credit contracts : design and regulation