@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function boot() |
| 21 | 21 | { |
| 22 | - $config_path = $this->app['path.config'] . DIRECTORY_SEPARATOR . 'coinbase.php'; |
|
| 23 | - $this->publishes([__DIR__ . '/../../config/config.php' => $config_path]); |
|
| 22 | + $config_path = $this->app['path.config'].DIRECTORY_SEPARATOR.'coinbase.php'; |
|
| 23 | + $this->publishes([__DIR__.'/../../config/config.php' => $config_path]); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function register() |
| 32 | 32 | { |
| 33 | - $this->mergeConfigFrom(__DIR__ . '/../../config/config.php', 'coinbase'); |
|
| 33 | + $this->mergeConfigFrom(__DIR__.'/../../config/config.php', 'coinbase'); |
|
| 34 | 34 | |
| 35 | - $this->app->singleton('coinbase', function ($app) { |
|
| 35 | + $this->app->singleton('coinbase', function($app) { |
|
| 36 | 36 | return new CoinbaseClient( |
| 37 | 37 | new Guzzle, |
| 38 | 38 | $app['config']->get('coinbase.apiKey'), |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | try |
| 79 | 79 | { |
| 80 | - $response = $this->client->post($this->endpoint . $path, [ |
|
| 80 | + $response = $this->client->post($this->endpoint.$path, [ |
|
| 81 | 81 | 'body' => $payload, |
| 82 | 82 | 'headers' => $headers |
| 83 | 83 | ]); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function getHeaders($timestamp, $method, $requestPath, $body) |
| 112 | 112 | { |
| 113 | - $accessSign = hash_hmac('sha256', ($timestamp . $method . $requestPath . $body), $this->apiSecret); |
|
| 113 | + $accessSign = hash_hmac('sha256', ($timestamp.$method.$requestPath.$body), $this->apiSecret); |
|
| 114 | 114 | |
| 115 | 115 | return [ |
| 116 | 116 | 'CB-ACCESS-KEY' => $this->apiKey, |
@@ -81,8 +81,7 @@ discard block |
||
| 81 | 81 | 'body' => $payload, |
| 82 | 82 | 'headers' => $headers |
| 83 | 83 | ]); |
| 84 | - } |
|
| 85 | - catch (\Exception $e) |
|
| 84 | + } catch (\Exception $e) |
|
| 86 | 85 | { |
| 87 | 86 | echo $e->getResponse(); |
| 88 | 87 | exit(0); |
@@ -90,8 +89,7 @@ discard block |
||
| 90 | 89 | if ((int) $response->getStatusCode() === 201) |
| 91 | 90 | { |
| 92 | 91 | return json_decode($response->getBody())->data; |
| 93 | - } |
|
| 94 | - else |
|
| 92 | + } else |
|
| 95 | 93 | { |
| 96 | 94 | throw new CoinbaseCheckoutException($response->getBody()); |
| 97 | 95 | } |