public static function getClient()
{
if (!self::$client) {
self::$client = new \GuzzleHttp\Client();
$token = base64_encode(self::$clientId . ':' . self::$clientSecret);
$res = self::$client->request('POST', 'https://authz.dinero.dk/dineroapi/oauth/token', ['verify' => false, 'headers' => ['Authorization' => 'Basic ' . $token], 'form_params' => ['grant_type' => 'password', 'scope' => 'read write', 'username' => self::$apiKey, 'password' => self::$apiKey]]);
$response = self::convertJson($res);
self::$accessToken = $response->access_token;
}
return self::$client;
}