|
|
@@ -141,6 +141,12 @@ class ConnectionService extends ApiRequestService
|
|
|
return $helloAssoEntity;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Génère le profil HelloAsso pour une organisation.
|
|
|
+ *
|
|
|
+ * @param int $organizationId
|
|
|
+ * @return HelloAssoProfile
|
|
|
+ */
|
|
|
public function makeHelloAssoProfile(int $organizationId): HelloAssoProfile
|
|
|
{
|
|
|
$organization = $this->entityManager->getRepository(Organization::class)->find($organizationId);
|
|
|
@@ -162,6 +168,11 @@ class ConnectionService extends ApiRequestService
|
|
|
return $profile;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Génère l'URL de rappel pour les callbacks suite à l'authentification HelloAsso
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
protected function getCallbackUrl(): string
|
|
|
{
|
|
|
return UrlBuilder::concat($this->publicAppBaseUrl, ['helloasso/callback']);
|
|
|
@@ -213,20 +224,6 @@ class ConnectionService extends ApiRequestService
|
|
|
throw new HttpException(500, 'Failed to fetch access token: '.$response->getContent(false));
|
|
|
}
|
|
|
|
|
|
-// $options = [
|
|
|
-// 'headers' => [
|
|
|
-// 'Content-Type' => 'application/x-www-form-urlencoded',
|
|
|
-// ],
|
|
|
-// 'body' => $body,
|
|
|
-// ];
|
|
|
-//
|
|
|
-// $response = $this->post(
|
|
|
-// UrlBuilder::concat($this->helloAssoApiBaseUrl, ['/oauth2/token']),
|
|
|
-// [],
|
|
|
-// [],
|
|
|
-// $options
|
|
|
-// );
|
|
|
-
|
|
|
try {
|
|
|
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
|
|
|