src/Duellsy/Pockpack/PockpackAuth.php
private function convertRequestToken($consumer_key, $request_token)
    {
        $params = array(
            'consumer_key'  => $consumer_key,
            'code'  => $request_token
        );

        $request = $this->getClient()->post('/v3/oauth/authorize');
        $request->getParams()->set('redirect.strict', true);
        $request->setHeader('Content-Type', 'application/json; charset=UTF8');
        $request->setHeader('X-Accept', 'application/json');
        $request->setBody(json_encode($params));
        $response = $request->send();

        $data = json_decode($response->getBody());

        return $data;
    }
private function convertRequestToken($consumer_key, $request_token)
    {
        $params = array(
            'consumer_key'  => $consumer_key,
            'code'  => $request_token
        );

        $request = $this->getClient()->post('/v3/oauth/authorize');
        $request->getParams()->set('redirect.strict', true);
        $request->setHeader('Content-Type', 'application/json; charset=UTF8');
        $request->setHeader('X-Accept', 'application/json');
        $request->setBody(json_encode($params));
        $response = $request->send();

        $data = json_decode($response->getBody());

        return $data;
    }
private function convertRequestToken ( $ consumer_key , $ request_token ) { $ params = array ( 'consumer_key' => $ consumer_key , 'code' => $ request_token ) ; $ request = $ this -> getClient ( ) -> post ( '/v3/oauth/authorize' ) ; $ request -> getParams ( ) -> set ( 'redirect.strict' , true ) ; $ request -> setHeader ( 'Content-Type' , 'application/json; charset=UTF8' ) ; $ request -> setHeader ( 'X-Accept' , 'application/json' ) ; $ request -> setBody ( json_encode ( $ params ) ) ; $ response = $ request -> send ( ) ; $ data = json_decode ( $ response -> getBody ( ) ) ; return $ data ; }
Convert a request token into a Pocket access token.
We also get the username in the same response from Pocket.

@param  string $consumer_key
@param  string $request_token
Convert a request token into a Pocket access token . We also get the username in the same response from Pocket .