src/Service/DefaultInstallationService.php
public function createSession(Token $token)
    {
        $response = $this->sendInstallationPostRequest(
            '/v1/session-server',
            [
                'headers' => [
                    'X-Bunq-Client-Authentication' => $token->toString(),
                ],
                'json'    => [
                    'secret' => $this->apiKey,
                ],
            ]
        );

        $responseArray = \json_decode((string)$response->getBody(), true);

        return $responseArray['Response'][1]['Token']['token'];
    }
public function createSession(Token $token)
    {
        $response = $this->sendInstallationPostRequest(
            '/v1/session-server',
            [
                'headers' => [
                    'X-Bunq-Client-Authentication' => $token->toString(),
                ],
                'json'    => [
                    'secret' => $this->apiKey,
                ],
            ]
        );

        $responseArray = \json_decode((string)$response->getBody(), true);

        return $responseArray['Response'][1]['Token']['token'];
    }
public function createSession ( Token $ token ) { $ response = $ this -> sendInstallationPostRequest ( '/v1/session-server' , [ 'headers' => [ 'X-Bunq-Client-Authentication' => $ token -> toString ( ) , ] , 'json' => [ 'secret' => $ this -> apiKey , ] , ] ) ; $ responseArray = \ json_decode ( ( string ) $ response -> getBody ( ) , true ) ; return $ responseArray [ 'Response' ] [ 1 ] [ 'Token' ] [ 'token' ] ; }
Registers a session with the Bunq API.

@param Token $token

@return array
Registers a session with the Bunq API .