def METHOD_NAME(self, dispute_id):
    try:
        if dispute_id is None or dispute_id.strip() == "":
            raise NotFoundError()
        response = self.config.http().put(self.config.base_merchant_path() + "/disputes/" + dispute_id + "/finalize")
        if "api_error_response" in response:
            return ErrorResult(self.gateway, response["api_error_response"])
        else:
            return SuccessfulResult()
    except NotFoundError:
        raise NotFoundError("dispute with id " + repr(dispute_id) + " not found")