@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists("paystack")) |
|
3 | +if (!function_exists("paystack")) |
|
4 | 4 | { |
5 | 5 | function paystack() { |
6 | 6 |
@@ -64,7 +64,7 @@ |
||
64 | 64 | { |
65 | 65 | $this->bootstrapConfig(); |
66 | 66 | |
67 | - $this->app->singleton('laravel-paystack', function () { |
|
67 | + $this->app->singleton('laravel-paystack', function() { |
|
68 | 68 | |
69 | 69 | return new Paystack($this->client); |
70 | 70 |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | * when the payload is built on the fly (not passed to the controller from a view) |
80 | 80 | * @return Paystack |
81 | 81 | */ |
82 | - public function makePaymentRequest( $data = null) |
|
82 | + public function makePaymentRequest($data = null) |
|
83 | 83 | { |
84 | - if ( $data == null ) { |
|
84 | + if ($data == null) { |
|
85 | 85 | $data = [ |
86 | 86 | "amount" => intval(request()->amount), |
87 | 87 | "reference" => request()->reference, |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | $this->response = $this->client->{strtolower($method)}( |
133 | - $this->baseUrl . $relativeUrl, |
|
133 | + $this->baseUrl.$relativeUrl, |
|
134 | 134 | ["body" => json_encode($body)] |
135 | 135 | ); |
136 | 136 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | |
177 | 177 | $relativeUrl = "/transaction/verify/{$transactionRef}"; |
178 | 178 | |
179 | - $this->response = $this->client->get($this->baseUrl . $relativeUrl, []); |
|
179 | + $this->response = $this->client->get($this->baseUrl.$relativeUrl, []); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | public function fetchCustomer($customer_id) |
389 | 389 | { |
390 | 390 | $this->setRequestOptions(); |
391 | - return $this->setHttpResponse('/customer/'. $customer_id, 'GET', [])->getResponse(); |
|
391 | + return $this->setHttpResponse('/customer/'.$customer_id, 'GET', [])->getResponse(); |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | /** |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | ]; |
409 | 409 | |
410 | 410 | $this->setRequestOptions(); |
411 | - return $this->setHttpResponse('/customer/'. $customer_id, 'PUT', $data)->getResponse(); |
|
411 | + return $this->setHttpResponse('/customer/'.$customer_id, 'PUT', $data)->getResponse(); |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | /** |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | { |
465 | 465 | $this->setRequestOptions(); |
466 | 466 | |
467 | - return $this->setHttpResponse('/subscription?customer=' . $customer_id, 'GET', [])->getData(); |
|
467 | + return $this->setHttpResponse('/subscription?customer='.$customer_id, 'GET', [])->getData(); |
|
468 | 468 | } |
469 | 469 | |
470 | 470 | /** |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | * @return array |
581 | 581 | */ |
582 | 582 | |
583 | - public function createSubAccount(){ |
|
583 | + public function createSubAccount() { |
|
584 | 584 | $data = [ |
585 | 585 | "business_name" => request()->business_name, |
586 | 586 | "settlement_bank" => request()->settlement_bank, |
@@ -603,10 +603,10 @@ discard block |
||
603 | 603 | * @param subaccount code |
604 | 604 | * @return array |
605 | 605 | */ |
606 | - public function fetchSubAccount($subaccount_code){ |
|
606 | + public function fetchSubAccount($subaccount_code) { |
|
607 | 607 | |
608 | 608 | $this->setRequestOptions(); |
609 | - return $this->setHttpResponse("/subaccount/{$subaccount_code}","GET",[])->getResponse(); |
|
609 | + return $this->setHttpResponse("/subaccount/{$subaccount_code}", "GET", [])->getResponse(); |
|
610 | 610 | |
611 | 611 | } |
612 | 612 | |
@@ -615,10 +615,10 @@ discard block |
||
615 | 615 | * @param $per_page - Specifies how many records to retrieve per page , $page - SPecifies exactly what page to retrieve |
616 | 616 | * @return array |
617 | 617 | */ |
618 | - public function listSubAccounts($per_page,$page){ |
|
618 | + public function listSubAccounts($per_page, $page) { |
|
619 | 619 | |
620 | 620 | $this->setRequestOptions(); |
621 | - return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page,"GET")->getResponse(); |
|
621 | + return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page, "GET")->getResponse(); |
|
622 | 622 | } |
623 | 623 | |
624 | 624 | |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | * @return array |
629 | 629 | */ |
630 | 630 | |
631 | - public function updateSubAccount($subaccount_code){ |
|
631 | + public function updateSubAccount($subaccount_code) { |
|
632 | 632 | $data = [ |
633 | 633 | "business_name" => request()->business_name, |
634 | 634 | "settlement_bank" => request()->settlement_bank, |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | class PaymentVerificationFailedException extends Exception |
17 | 17 | { |
18 | - public function __construct ($message = "") |
|
18 | + public function __construct($message = "") |
|
19 | 19 | { |
20 | 20 | parent::__construct(($message ? $message : "Payment Verification Failed."), 400); |
21 | 21 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | class IsNullException extends Exception |
17 | 17 | { |
18 | - public function __construct ($message = "") |
|
18 | + public function __construct($message = "") |
|
19 | 19 | { |
20 | 20 | parent::__construct(($message ? $message : "Bad method call."), 400); |
21 | 21 | } |