@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $this->customerId = $customerId; |
19 | 19 | $this->client = new GuzzleClient([ |
20 | 20 | 'base_uri' => config('services.dnb.endpoint'), |
21 | - 'handler' => tap(HandlerStack::create(new CurlHandler()), function ($stack) { |
|
21 | + 'handler' => tap(HandlerStack::create(new CurlHandler()), function($stack) { |
|
22 | 22 | $stack->push(new DNBRequestHandler( |
23 | 23 | new Credentials( |
24 | 24 | config('services.dnb.client_id'), |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | ]); |
32 | 32 | } |
33 | 33 | |
34 | - public function fetch($endpoint, $method = 'GET', $params = []) |
|
34 | + public function fetch($endpoint, $method = 'GET', $params = [ ]) |
|
35 | 35 | { |
36 | 36 | return json_decode( |
37 | 37 | $this->client |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | |
63 | 63 | public function getAccountTransactions($accountNumber, $from = null, $to = null) |
64 | 64 | { |
65 | - $from = $from ? Carbon::parse($from) : now()->subMonth(); |
|
66 | - $to = $to ? Carbon::parse($to) : now(); |
|
65 | + $from = $from ? Carbon::parse($from) : now()->subMonth(); |
|
66 | + $to = $to ? Carbon::parse($to) : now(); |
|
67 | 67 | return $this->fetch("/transactions/{$accountNumber}", 'GET', [ |
68 | 68 | 'query' => [ |
69 | 69 | 'fromDate' => $from->toDateString(), |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | if (is_array($location)) { |
151 | 151 | return $this->fetch('/locations/branches/coordinates', 'GET', [ |
152 | 152 | 'query' => [ |
153 | - 'latitude' => $location[0], |
|
154 | - 'longitude' => $location[1] |
|
153 | + 'latitude' => $location[ 0 ], |
|
154 | + 'longitude' => $location[ 1 ] |
|
155 | 155 | ] |
156 | 156 | ]); |
157 | 157 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | public function __invoke(callable $handler) |
33 | 33 | { |
34 | - return function (RequestInterface $request, array $options) use ($handler) { |
|
34 | + return function(RequestInterface $request, array $options) use ($handler) { |
|
35 | 35 | return $handler( |
36 | 36 | $this->signer->signRequest( |
37 | 37 | $request->withAddedHeader('Accept', 'application/json') |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | config('services.dnb.region') ?? 'eu-west-1' |
32 | 32 | ); |
33 | 33 | |
34 | - $this->cache_key = 'services.dnb.token.'.$this->customerId; |
|
34 | + $this->cache_key = 'services.dnb.token.' . $this->customerId; |
|
35 | 35 | $this->token = null; |
36 | 36 | } |
37 | 37 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $this->credentials |
67 | 67 | ); |
68 | 68 | $response = (new Client)->send($signedrequest); |
69 | - return tap(collect(json_decode($response->getBody())->tokenInfo)->first(), function ($token) use ($cache) { |
|
69 | + return tap(collect(json_decode($response->getBody())->tokenInfo)->first(), function($token) use ($cache) { |
|
70 | 70 | if ($cache) { |
71 | 71 | Cache::put($this->cache_key, $token, $this->duration); |
72 | 72 | } |