1 | <?php |
||
14 | class Webhook extends AbstractApi |
||
15 | { |
||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $appSecret; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $verifyToken; |
||
25 | |||
26 | /** |
||
27 | * @var \Psr\Http\Message\ServerRequestInterface |
||
28 | */ |
||
29 | protected $request; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $body; |
||
35 | |||
36 | /** |
||
37 | * @var array |
||
38 | */ |
||
39 | protected $decodedBody; |
||
40 | |||
41 | /** |
||
42 | * @var \Kerox\Messenger\Model\Callback\Entry[] |
||
43 | */ |
||
44 | protected $hydratedEntries; |
||
45 | |||
46 | /** |
||
47 | * Webhook constructor. |
||
48 | * |
||
49 | * @param \Psr\Http\Message\ServerRequestInterface $request |
||
50 | */ |
||
51 | 12 | public function __construct( |
|
64 | |||
65 | 3 | public function isValidToken(): bool |
|
78 | |||
79 | 1 | public function challenge(): ?string |
|
85 | |||
86 | 1 | public function subscribe(): WebhookResponse |
|
93 | |||
94 | /** |
||
95 | * @throws \Exception |
||
96 | */ |
||
97 | 2 | public function isValidCallback(): bool |
|
110 | |||
111 | 7 | public function getBody(): string |
|
119 | |||
120 | /** |
||
121 | * @throws \Exception |
||
122 | */ |
||
123 | 6 | public function getDecodedBody(): array |
|
136 | |||
137 | /** |
||
138 | * @throws \Exception |
||
139 | * |
||
140 | * @return \Kerox\Messenger\Model\Callback\Entry[] |
||
141 | */ |
||
142 | 1 | public function getCallbackEntries(): array |
|
146 | |||
147 | /** |
||
148 | * @throws \Exception |
||
149 | */ |
||
150 | 2 | public function getCallbackEvents(): array |
|
160 | |||
161 | /** |
||
162 | * @throws \Exception |
||
163 | * |
||
164 | * @return \Kerox\Messenger\Model\Callback\Entry[] |
||
165 | */ |
||
166 | 3 | private function getHydratedEntries(): array |
|
181 | |||
182 | 2 | private function isValidHubSignature(): bool |
|
195 | } |
||
196 |