@@ -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 | |
@@ -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 | [ |
@@ -109,9 +109,9 @@ discard block |
||
| 109 | 109 | * @return Paystack |
| 110 | 110 | */ |
| 111 | 111 | |
| 112 | - public function makePaymentRequest( $data = null) |
|
| 112 | + public function makePaymentRequest($data = null) |
|
| 113 | 113 | { |
| 114 | - if ( $data == null ) { |
|
| 114 | + if ($data == null) { |
|
| 115 | 115 | $data = [ |
| 116 | 116 | "amount" => intval(request()->amount), |
| 117 | 117 | "reference" => request()->reference, |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | $this->response = $this->client->{strtolower($method)}( |
| 163 | - $this->baseUrl . $relativeUrl, |
|
| 163 | + $this->baseUrl.$relativeUrl, |
|
| 164 | 164 | ["body" => json_encode($body)] |
| 165 | 165 | ); |
| 166 | 166 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | |
| 205 | 205 | $relativeUrl = "/transaction/verify/{$transactionRef}"; |
| 206 | 206 | |
| 207 | - $this->response = $this->client->get($this->baseUrl . $relativeUrl, []); |
|
| 207 | + $this->response = $this->client->get($this->baseUrl.$relativeUrl, []); |
|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | /** |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | public function fetchPlan($plan_code) |
| 353 | 353 | { |
| 354 | 354 | $this->setRequestOptions(); |
| 355 | - return $this->setHttpResponse('/plan/' . $plan_code, 'GET', [])->getResponse(); |
|
| 355 | + return $this->setHttpResponse('/plan/'.$plan_code, 'GET', [])->getResponse(); |
|
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | /** |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | ]; |
| 374 | 374 | |
| 375 | 375 | $this->setRequestOptions(); |
| 376 | - return $this->setHttpResponse('/plan/' . $plan_code, 'PUT', $data)->getResponse(); |
|
| 376 | + return $this->setHttpResponse('/plan/'.$plan_code, 'PUT', $data)->getResponse(); |
|
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | /** |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | public function fetchCustomer($customer_id) |
| 404 | 404 | { |
| 405 | 405 | $this->setRequestOptions(); |
| 406 | - return $this->setHttpResponse('/customer/'. $customer_id, 'GET', [])->getResponse(); |
|
| 406 | + return $this->setHttpResponse('/customer/'.$customer_id, 'GET', [])->getResponse(); |
|
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | /** |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | ]; |
| 424 | 424 | |
| 425 | 425 | $this->setRequestOptions(); |
| 426 | - return $this->setHttpResponse('/customer/'. $customer_id, 'PUT', $data)->getResponse(); |
|
| 426 | + return $this->setHttpResponse('/customer/'.$customer_id, 'PUT', $data)->getResponse(); |
|
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | /** |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | { |
| 480 | 480 | $this->setRequestOptions(); |
| 481 | 481 | |
| 482 | - return $this->setHttpResponse('/subscription?customer=' . $customer_id, 'GET', [])->getData(); |
|
| 482 | + return $this->setHttpResponse('/subscription?customer='.$customer_id, 'GET', [])->getData(); |
|
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | /** |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | { |
| 493 | 493 | $this->setRequestOptions(); |
| 494 | 494 | |
| 495 | - return $this->setHttpResponse('/subscription?plan=' . $plan_id, 'GET', [])->getData(); |
|
| 495 | + return $this->setHttpResponse('/subscription?plan='.$plan_id, 'GET', [])->getData(); |
|
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | /** |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | * @return array |
| 596 | 596 | */ |
| 597 | 597 | |
| 598 | - public function createSubAccount(){ |
|
| 598 | + public function createSubAccount() { |
|
| 599 | 599 | $data = [ |
| 600 | 600 | "business_name" => request()->business_name, |
| 601 | 601 | "settlement_bank" => request()->settlement_bank, |
@@ -619,10 +619,10 @@ discard block |
||
| 619 | 619 | * @param subaccount code |
| 620 | 620 | * @return array |
| 621 | 621 | */ |
| 622 | - public function fetchSubAccount($subaccount_code){ |
|
| 622 | + public function fetchSubAccount($subaccount_code) { |
|
| 623 | 623 | |
| 624 | 624 | $this->setRequestOptions(); |
| 625 | - return $this->setHttpResponse("/subaccount/{$subaccount_code}","GET",[])->getResponse(); |
|
| 625 | + return $this->setHttpResponse("/subaccount/{$subaccount_code}", "GET", [])->getResponse(); |
|
| 626 | 626 | |
| 627 | 627 | } |
| 628 | 628 | |
@@ -631,13 +631,13 @@ discard block |
||
| 631 | 631 | * @param $per_page - Specifies how many records to retrieve per page , $page - SPecifies exactly what page to retrieve |
| 632 | 632 | * @return array |
| 633 | 633 | */ |
| 634 | - public function listSubAccounts($per_page,$page){ |
|
| 634 | + public function listSubAccounts($per_page, $page) { |
|
| 635 | 635 | |
| 636 | 636 | |
| 637 | 637 | |
| 638 | 638 | $this->setRequestOptions(); |
| 639 | 639 | |
| 640 | - return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page,"GET")->getResponse(); |
|
| 640 | + return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page, "GET")->getResponse(); |
|
| 641 | 641 | |
| 642 | 642 | } |
| 643 | 643 | |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | * @return array |
| 649 | 649 | */ |
| 650 | 650 | |
| 651 | - public function updateSubAccount($subaccount_code){ |
|
| 651 | + public function updateSubAccount($subaccount_code) { |
|
| 652 | 652 | $data = [ |
| 653 | 653 | "business_name" => request()->business_name, |
| 654 | 654 | "settlement_bank" => request()->settlement_bank, |