Passed
Branch feature/add-webhook-services (535460)
by Eudald
02:00
created
src/config/gocardless.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Controllers/GocardlessWebhookController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
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'] ?? '',
Please login to merge, or discard this patch.
src/Middlewares/VerifySignature.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.