buildAuthUrlFromBase(static::MOLLIE_WEB_URL.'/oauth2/authorize', $state); } /** * Get the token URL for the provider. * * @return string */ protected function getTokenUrl() { return static::MOLLIE_API_URL.'/oauth2/tokens'; } /** * Get the raw user for the given access token. * * @param string $token * @return array */ protected function getUserByToken($token) { $response = $this->getHttpClient()->get(static::MOLLIE_API_URL.'/v2/organizations/me', [ 'headers' => ['Authorization' => 'Bearer '.$token], ]); return json_decode($response->getBody(), true); } /** * Map the raw user array to a Socialite User instance. * * @return \Laravel\Socialite\AbstractUser */ protected function mapUserToObject(array $user) { return (new User)->setRaw($user)->map([ 'id' => $user['id'], 'nickname' => $user['name'], 'name' => $user['name'], 'email' => $user['email'], 'avatar' => null, ]); } }