def fetch_access_token(self, redirect_uri, authorization_code):
        params = {
            "client_id": self._app_id,
            "code": authorization_code,
            "redirect_uri": redirect_uri,
            "grant_type": "authorization_code"
        }
        query = to_query(params)
        url = "/oauth/access_token?{0}".format(query)
        # have to use _request so we don't add api_base to the url
        auth_details = (self._app_id, self._app_secret)
        result = self._request("post", url, auth=auth_details)
        self._access_token = result["access_token"]
        self._merchant_id = result["scope"].split(":")[1]
        return self._access_token
Fetch the access token for a merchant
dataset/ETHPy150Open gocardless/gocardless-python/gocardless/client.py/Client.fetch_access_token