def get_token(
            self, redirect_uri, client_id, client_secret,
            code, callback_uri=None):
        """
        Calls wepay.com/v2/oauth2/token to get an access token. Sets the
        access_token for the WePay instance and returns the entire response
        as a dict. Should only be called after the user returns from being
        sent to get_authorization_url.

        :param str redirect_uri: The same URI specified in the
            :py:meth:`get_authorization_url` call that preceeded this.
        :param str client_id: The client ID issued by WePay to your app.
        :param str client_secret: The client secret issued by WePay
            to your app.
        :param str code: The code returned by :py:meth:`get_authorization_url`.
        :param str callback_uri: The callback_uri you want to receive IPNs for
            this user on.
        """
        params = {
            'redirect_uri': redirect_uri,
            'client_id': client_id,
            'client_secret': client_secret,
            'code': code,
        }
        if callback_uri:
            params.update({'callback_uri': callback_uri})
        response = self.call('/oauth2/token', params)
      
        # The call to /oauth2/token should return an access_token
        # if the access_token was not returned, then an error occured
        # we need to raise this error, 
        # otherwise this will die when trying to use the 'access_token' field
        if 'access_token' not in response:
            raise WePayError(response['error'], response['error_code'], response['error_description'])

        self.access_token = response['access_token']
        return response