@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | protected $defer = false; |
25 | 25 | |
26 | 26 | /** |
27 | - * Publishes all the config file this package needs to function |
|
28 | - */ |
|
27 | + * Publishes all the config file this package needs to function |
|
28 | + */ |
|
29 | 29 | public function boot() |
30 | 30 | { |
31 | 31 | $config = realpath(__DIR__.'/../resources/config/paystack.php'); |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
39 | - * Register the application services. |
|
40 | - */ |
|
39 | + * Register the application services. |
|
40 | + */ |
|
41 | 41 | public function register() |
42 | 42 | { |
43 | 43 | $this->app->bind('laravel-paystack', function () { |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | - * Get the services provided by the provider |
|
52 | - * @return array |
|
53 | - */ |
|
51 | + * Get the services provided by the provider |
|
52 | + * @return array |
|
53 | + */ |
|
54 | 54 | public function provides() |
55 | 55 | { |
56 | 56 | return ['laravel-paystack']; |
@@ -40,7 +40,7 @@ |
||
40 | 40 | */ |
41 | 41 | public function register() |
42 | 42 | { |
43 | - $this->app->bind('laravel-paystack', function () { |
|
43 | + $this->app->bind('laravel-paystack', function() { |
|
44 | 44 | |
45 | 45 | return new Paystack; |
46 | 46 |
@@ -178,11 +178,11 @@ |
||
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
181 | - * Get the authorization callback response |
|
182 | - * In situations where Laravel serves as an backend for a detached UI, the api cannot redirect |
|
183 | - * and might need to take different actions based on the success or not of the transaction |
|
184 | - * @return array |
|
185 | - */ |
|
181 | + * Get the authorization callback response |
|
182 | + * In situations where Laravel serves as an backend for a detached UI, the api cannot redirect |
|
183 | + * and might need to take different actions based on the success or not of the transaction |
|
184 | + * @return array |
|
185 | + */ |
|
186 | 186 | public function getAuthorizationResponse($data) |
187 | 187 | { |
188 | 188 | $this->makePaymentRequest($data); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | private function setRequestOptions() |
88 | 88 | { |
89 | - $authBearer = 'Bearer '. $this->secretKey; |
|
89 | + $authBearer = 'Bearer '.$this->secretKey; |
|
90 | 90 | |
91 | 91 | $this->client = new Client( |
92 | 92 | [ |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | * when the payload is built on the fly (not passed to the controller from a view) |
107 | 107 | * @return Paystack |
108 | 108 | */ |
109 | - public function makePaymentRequest( $data = null) |
|
109 | + public function makePaymentRequest($data = null) |
|
110 | 110 | { |
111 | - if ( $data == null ) { |
|
111 | + if ($data == null) { |
|
112 | 112 | $data = [ |
113 | 113 | "amount" => intval(request()->amount), |
114 | 114 | "reference" => request()->reference, |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | } |
158 | 158 | |
159 | 159 | $this->response = $this->client->{strtolower($method)}( |
160 | - $this->baseUrl . $relativeUrl, |
|
160 | + $this->baseUrl.$relativeUrl, |
|
161 | 161 | ["body" => json_encode($body)] |
162 | 162 | ); |
163 | 163 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | |
202 | 202 | $relativeUrl = "/transaction/verify/{$transactionRef}"; |
203 | 203 | |
204 | - $this->response = $this->client->get($this->baseUrl . $relativeUrl, []); |
|
204 | + $this->response = $this->client->get($this->baseUrl.$relativeUrl, []); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | public function fetchPlan($plan_code) |
349 | 349 | { |
350 | 350 | $this->setRequestOptions(); |
351 | - return $this->setHttpResponse('/plan/' . $plan_code, 'GET', [])->getResponse(); |
|
351 | + return $this->setHttpResponse('/plan/'.$plan_code, 'GET', [])->getResponse(); |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | /** |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | ]; |
370 | 370 | |
371 | 371 | $this->setRequestOptions(); |
372 | - return $this->setHttpResponse('/plan/' . $plan_code, 'PUT', $data)->getResponse(); |
|
372 | + return $this->setHttpResponse('/plan/'.$plan_code, 'PUT', $data)->getResponse(); |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | /** |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | public function fetchCustomer($customer_id) |
399 | 399 | { |
400 | 400 | $this->setRequestOptions(); |
401 | - return $this->setHttpResponse('/customer/'. $customer_id, 'GET', [])->getResponse(); |
|
401 | + return $this->setHttpResponse('/customer/'.$customer_id, 'GET', [])->getResponse(); |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | /** |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | ]; |
419 | 419 | |
420 | 420 | $this->setRequestOptions(); |
421 | - return $this->setHttpResponse('/customer/'. $customer_id, 'PUT', $data)->getResponse(); |
|
421 | + return $this->setHttpResponse('/customer/'.$customer_id, 'PUT', $data)->getResponse(); |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | /** |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | { |
475 | 475 | $this->setRequestOptions(); |
476 | 476 | |
477 | - return $this->setHttpResponse('/subscription?customer=' . $customer_id, 'GET', [])->getData(); |
|
477 | + return $this->setHttpResponse('/subscription?customer='.$customer_id, 'GET', [])->getData(); |
|
478 | 478 | } |
479 | 479 | |
480 | 480 | /** |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | { |
488 | 488 | $this->setRequestOptions(); |
489 | 489 | |
490 | - return $this->setHttpResponse('/subscription?plan=' . $plan_id, 'GET', [])->getData(); |
|
490 | + return $this->setHttpResponse('/subscription?plan='.$plan_id, 'GET', [])->getData(); |
|
491 | 491 | } |
492 | 492 | |
493 | 493 | /** |