1 | <?php |
||||
2 | /** |
||||
3 | * Created by PhpStorm. |
||||
4 | * User: eudaldarranztresserra |
||||
5 | * Date: 2019-03-01 |
||||
6 | * Time: 13:07 |
||||
7 | */ |
||||
8 | |||||
9 | namespace Nestednet\Gocardless\Exceptions; |
||||
10 | |||||
11 | use Exception; |
||||
12 | use Nestednet\Gocardless\GocardlessWebhookCall; |
||||
13 | |||||
14 | class WebhookFailed extends Exception |
||||
15 | { |
||||
16 | public static function missingSignature() |
||||
17 | { |
||||
18 | return new static('The request did not contain a Signature header - `Webhook-Signature`.'); |
||||
19 | } |
||||
20 | |||||
21 | public static function invalidSignature($signature) |
||||
22 | { |
||||
23 | return new static("The signature: {$signature} found in the header is invalid."); |
||||
24 | } |
||||
25 | |||||
26 | public static function noSecretKeyProvided() |
||||
27 | { |
||||
28 | return new static('The webhook secret key is not set.'); |
||||
29 | } |
||||
30 | |||||
31 | public static function jobClassDoesNotExist(string $jobClass, GocardlessWebhookCall $webhookCall) |
||||
32 | { |
||||
33 | return new static("Could not process webhook id `{$webhookCall->id}` of type `{$webhookCall->type} because the configured jobclass `$jobClass` does not exist."); |
||||
34 | } |
||||
35 | |||||
36 | public static function missingResource(GocardlessWebhookCall $webhookCall) |
||||
37 | { |
||||
38 | return new static("Webhook call id `{$webhookCall->id}` did not contain a resource type. Valid Gocardless webhook calls should always contain a resource type."); |
||||
39 | } |
||||
40 | |||||
41 | public static function missingAction(GocardlessWebhookCall $webhookCall) |
||||
42 | { |
||||
43 | return new static("Webhook call id `{$webhookCall->id}` did not contain an action. Valid Gocardless webhook calls should always contain an action."); |
||||
44 | } |
||||
45 | |||||
46 | public function render($request) |
||||
0 ignored issues
–
show
|
|||||
47 | { |
||||
48 | return response(['error' => $this->getMessage()], 400); |
||||
0 ignored issues
–
show
The function
response was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
49 | } |
||||
50 | |||||
51 | } |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.