/** * @param string $authAccessToken * @return string * @throws Exception */ public function callUserData($authAccessToken) { $hash = hash_hmac('sha256', $authAccessToken, $this->config->getAppSecret()); $response = $this->call($this->config->getUrlUser(), ['query' => ['appsecret_proof' => $hash, 'access_token' => $authAccessToken]]); $userResponse = $this->convertResponse($response); if (!isset($userResponse['phone']['number'])) { throw new ResponseFieldException('phone number'); } $this->userPhone = $userResponse['phone']; }
/** * @covers Ingresse\Accountkit\Config */ public function testConfig() { $config = new Config(['app_id' => 123, 'app_secret' => 'abc123']); $this->assertEquals(123, $config->getAppId()); $this->assertEquals('abc123', $config->getAppSecret()); }