code: def check_payment(self, payment):
          
          validation = ""
  
          if not isinstance(payment['amount'], int):
              validation += "AMOUNT_NOT_INTEGER "
  
          if not isinstance(payment['mandate_date'], datetime.date):
              validation += "MANDATE_DATE_INVALID_OR_NOT_DATETIME_INSTANCE"
          payment['mandate_date'] = str(payment['mandate_date'])
  
          if not isinstance(payment['collection_date'], datetime.date):
              validation += "COLLECTION_DATE_INVALID_OR_NOT_DATETIME_INSTANCE"
          payment['collection_date'] = str(payment['collection_date'])
  
          if validation == "":
              return True
          else:
              raise Exception('Payment did not validate: ' + validation)
docs: Check the payment for required fields and validity.
          @param payment: The payment dict
          @return: True if valid, error string if invalid paramaters where
          encountered.