@@ -45,7 +45,7 @@ |
||
| 45 | 45 | * Your Gocardless jobs that will handle the events. |
| 46 | 46 | */ |
| 47 | 47 | 'jobs' => [ |
| 48 | - // 'payments_confirmed' => \App\Jobs\GocardlessWebhooks\HandleConfirmedPayment::class |
|
| 48 | + // 'payments_confirmed' => \App\Jobs\GocardlessWebhooks\HandleConfirmedPayment::class |
|
| 49 | 49 | ], |
| 50 | 50 | ], |
| 51 | 51 | ]; |
| 52 | 52 | \ No newline at end of file |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | return; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if (! class_exists($jobClass)) { |
|
| 43 | + if (!class_exists($jobClass)) { |
|
| 44 | 44 | throw WebhookFailed::jobClassDoesNotExist($jobClass, $this); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -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('webhook_endpoint_secret_'.$configKey) : |
|
| 37 | - config('webhook_endpoint_secret'); |
|
| 36 | + config('webhook_endpoint_secret_' . $configKey) : config('webhook_endpoint_secret'); |
|
| 38 | 37 | |
| 39 | 38 | if (empty($secret)) { |
| 40 | 39 | throw WebhookFailed::noSecretKeyProvided(); |
@@ -31,18 +31,18 @@ discard block |
||
| 31 | 31 | public function boot() |
| 32 | 32 | { |
| 33 | 33 | $this->publishes([ |
| 34 | - __DIR__.'/config/gocardless.php' => config_path('gocardless.php'), |
|
| 34 | + __DIR__ . '/config/gocardless.php' => config_path('gocardless.php'), |
|
| 35 | 35 | ], 'config'); |
| 36 | 36 | |
| 37 | - if (! class_exists('CreateGocardlessWebhookClassTable')) { |
|
| 37 | + if (!class_exists('CreateGocardlessWebhookClassTable')) { |
|
| 38 | 38 | $timestamp = date('Y_m_d_His', time()); |
| 39 | 39 | |
| 40 | 40 | $this->publishes([ |
| 41 | - __DIR__.'/../database/migrations/create_gocardless_webhook_calls_table.php.stub' => database_path('migrations/'.$timestamp.'_create_gocardless_webhook_calls_table.php'), |
|
| 41 | + __DIR__ . '/../database/migrations/create_gocardless_webhook_calls_table.php.stub' => database_path('migrations/' . $timestamp . '_create_gocardless_webhook_calls_table.php'), |
|
| 42 | 42 | ], 'migrations'); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - Route::macro('gocardlessWebhooks', function ($url) { |
|
| 45 | + Route::macro('gocardlessWebhooks', function($url) { |
|
| 46 | 46 | return Route::post($url, '\Nestednet\Gocardless\Controllers\GocardlessWebhookController'); |
| 47 | 47 | }); |
| 48 | 48 | } |
@@ -74,11 +74,11 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | protected function registerGocardless() |
| 76 | 76 | { |
| 77 | - $this->app->singleton('gocardless', function ($app) { |
|
| 77 | + $this->app->singleton('gocardless', function($app) { |
|
| 78 | 78 | $config = $app['config']->get('gocardless'); |
| 79 | 79 | $token = isset($config['token']) ? $config['token'] : null; |
| 80 | 80 | $environment = isset($config['environment']) ? $config['environment'] : null; |
| 81 | - return new Client( array ( |
|
| 81 | + return new Client(array( |
|
| 82 | 82 | 'access_token' => $token, |
| 83 | 83 | 'environment' => $environment |
| 84 | 84 | )); |