Conditions | 5 |
Paths | 4 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function handle() |
||
11 | { |
||
12 | if (!isset($this->webhookCall->payload['type']) || $this->webhookCall->payload['type'] === '') { |
||
13 | throw WebhookFailed::missingType($this->webhookCall); |
||
14 | } |
||
15 | |||
16 | event("stripe-webhooks::{$this->webhookCall->payload['type']}", $this->webhookCall); |
||
17 | |||
18 | $jobClass = $this->determineJobClass($this->webhookCall->payload['type']); |
||
19 | |||
20 | if ($jobClass === '') { |
||
21 | return; |
||
22 | } |
||
23 | |||
24 | if (! class_exists($jobClass)) { |
||
25 | throw WebhookFailed::jobClassDoesNotExist($jobClass, $this->webhookCall); |
||
26 | } |
||
27 | |||
28 | dispatch(new $jobClass($this->webhookCall)); |
||
29 | } |
||
30 | |||
38 |