def METHOD_NAME(self, **kw):
    "Returns a text with the result of anaf request from redirect"
    uid = request.uid
    user = request.env["res.users"].browse(uid)
    now = datetime.now()
    ANAF_Configs = request.env["l10n.ro.account.anaf.sync"].sudo()
    anaf_config = ANAF_Configs.search(
        [
            ("client_id", "!=", ""),
            ("last_request_datetime", ">", now - timedelta(seconds=90)),
        ]
    )
    message = ""
    if len(anaf_config) > 1:
        message = _(
            "More than one ANAF config requested authentification in the last minutes."
            "Please request them in order, waiting for 2 minutes between requests."
        )
    elif not anaf_config:
        message = _("The response was done too late.\nResponse was: kw=%s") % kw
    if message:
        anaf_config.message_post(body=message)
        values = {"message": message}
        return request.render("l10n_ro_account_anaf_sync.redirect_anaf", values)
    code = kw.get("code")
    if code:
        headers = {
            "content-type": "application/x-www-form-urlencoded",
            "accept": "application/json",
            "user-agent": "PostmanRuntime/7.29.2",
        }
        redirect_uri = user.get_base_url() + "/l10n_ro_account_anaf_sync/anaf_oauth"
        data = {
            "grant_type": "authorization_code",
            "client_id": "%s",
            "client_secret": "%s",
            "code": "%s",
            "access_key": "%s",
            "redirect_uri": "%s",
        } % (
            anaf_config.client_id,
            anaf_config.client_secret,
            code,
            code,
            redirect_uri,
        )
        response = requests.post(
            anaf_config.anaf_oauth_url + "/token",
            data=data,
            headers=headers,
            timeout=1.5,
        )
        response_json = response.json()
        message = _("The response was finished.\nResponse was: %s") % response_json
        anaf_config.write(
            {
                "code": code,
                "client_token_valability": now + timedelta(days=89),
                "access_token": response_json.get("access_token", ""),
                "refresh_token": response_json.get("refresh_token", ""),
            }
        )
    else:
        message = _("No code was found in the response.\nResponse was: %s") % kw
    anaf_config.message_post(body=message)
    values = {"message": message}
    return str(values)