Skip to content

Commit

Permalink
fix: Iaphub test payload
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkhansrc committed Mar 1, 2022
1 parent f4e02be commit 5afd124
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Controller/IaphubWebhookEntrypointController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ public function index(Request $request): JsonResponse
return $this->json([], Response::HTTP_UNAUTHORIZED);
}

if (!$request->getContent()) {
$payload = json_decode($request->getContent(), true, 512, JSON_THROW_ON_ERROR);

if ('test' === $payload['type']) {
// When add webhook url on Iaphub configuration, Iaphub should verify URL.
return $this->json([]);
}

$payload = json_decode($request->getContent(), true, 512, JSON_THROW_ON_ERROR);
$webhook = $this->webhookFactory::build($payload);

switch ($webhook->getType()) {
Expand Down

0 comments on commit 5afd124

Please sign in to comment.