Skip to content

Commit

Permalink
webhook fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yparitcher committed Nov 25, 2024
1 parent 1635824 commit 7cd0dbb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/RingCentral.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,11 @@ public function createWebhook(array $filters, int $expiresIn, string $address):
'deliveryMode' => [
'transportType' => 'WebHook',
'address' => $address,
'verificationToken' => $this->verification_token,
],
];
if ($this->verification_token) {
$data['deliveryMode']['verificationToken'] = $this->verification_token;
}
return $this->post('/subscription', $data);
}

Expand Down
4 changes: 4 additions & 0 deletions src/RingCentralServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ protected function createRingCentralClient(): RingCentral {
$ringCentral->setJwt(config('ringcentral.jwt'));
}

if ($this->ringCentralConfigHas('verification_token')) {
$ringCentral->setVerificationToken(config('ringcentral.verification_token'));
}

return $ringCentral;
}

Expand Down

0 comments on commit 7cd0dbb

Please sign in to comment.