def check_payment(self, payment):
validation = "<STR_LIT>"<EOL>required = ["<STR_LIT:name>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT:description>"]<EOL>for config_item in required:<EOL><INDENT>if config_item not in payment:<EOL><INDENT>validation += config_item.upper() + "<STR_LIT>"<EOL><DEDENT><DEDENT>if not isinstance(payment['<STR_LIT>'], int):<EOL><INDENT>validation += "<STR_LIT>"<EOL><DEDENT>if '<STR_LIT>' in payment:<EOL><INDENT>if not isinstance(payment['<STR_LIT>'], datetime.date):<EOL><INDENT>validation += "<STR_LIT>"<EOL><DEDENT>payment['<STR_LIT>'] = payment['<STR_LIT>'].isoformat()<EOL><DEDENT>if validation == "<STR_LIT>":<EOL><INDENT>return True<EOL><DEDENT>else:<EOL><INDENT>raise Exception('<STR_LIT>' + validation)<EOL><DEDENT>
Check the payment for required fields and validity.
@param payment: The payment dict
@return: True if valid, error string if invalid paramaters where
encountered.