@@ -46,7 +46,7 @@ |
||
| 46 | 46 | * The key is: {event_resource}_{event_action} |
| 47 | 47 | */ |
| 48 | 48 | 'jobs' => [ |
| 49 | - // 'payments_confirmed' => \App\Jobs\GocardlessWebhooks\HandleConfirmedPayment::class |
|
| 49 | + // 'payments_confirmed' => \App\Jobs\GocardlessWebhooks\HandleConfirmedPayment::class |
|
| 50 | 50 | ], |
| 51 | 51 | ], |
| 52 | 52 | ]; |
| 53 | 53 | \ No newline at end of file |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | $payload = $request->input(); |
| 26 | 26 | $modelClass = config('gocardless.webhooks.model'); |
| 27 | 27 | |
| 28 | - foreach($payload['events'] as $event) { |
|
| 28 | + foreach ($payload['events'] as $event) { |
|
| 29 | 29 | $gocardlessWebhookCall = $modelClass::create([ |
| 30 | 30 | 'resource_type' => $event['resource_type'] ?? '', |
| 31 | 31 | 'action' => $event['action'] ?? '', |
@@ -19,11 +19,11 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | $signature = $request->header('Webhook-Signature'); |
| 21 | 21 | |
| 22 | - if (! $signature) { |
|
| 22 | + if (!$signature) { |
|
| 23 | 23 | throw WebhookFailed::missingSignature(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - if (! $this->isValid($signature, $request->getContent(), $request->route('configKey'))) { |
|
| 26 | + if (!$this->isValid($signature, $request->getContent(), $request->route('configKey'))) { |
|
| 27 | 27 | throw WebhookFailed::invalidSignature($signature); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -33,8 +33,7 @@ discard block |
||
| 33 | 33 | protected function isValid(string $signature, string $payload, string $configKey = null) : bool |
| 34 | 34 | { |
| 35 | 35 | $secret = ($configKey) ? |
| 36 | - config('gocardless.webhooks.webhook_endpoint_secret_'.$configKey) : |
|
| 37 | - config('gocardless.webhooks.webhook_endpoint_secret'); |
|
| 36 | + config('gocardless.webhooks.webhook_endpoint_secret_' . $configKey) : config('gocardless.webhooks.webhook_endpoint_secret'); |
|
| 38 | 37 | |
| 39 | 38 | if (empty($secret)) { |
| 40 | 39 | throw WebhookFailed::noSecretKeyProvided(); |