@@ -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 | |
@@ -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 | |
@@ -102,7 +102,6 @@ |
||
| 102 | 102 | |
| 103 | 103 | |
| 104 | 104 | /** |
| 105 | - |
|
| 106 | 105 | * Initiate a payment request to Paystack |
| 107 | 106 | * Included the option to pass the payload to this method for situations |
| 108 | 107 | * when the payload is built on the fly (not passed to the controller from a view) |
@@ -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 | [ |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | "first_name" => request()->first_name, |
| 124 | 124 | "last_name" => request()->last_name, |
| 125 | 125 | "callback_url" => request()->callback_url, |
| 126 | - "currency" => (request()->currency != "" ? request()->currency : "NGN"), |
|
| 126 | + "currency" => (request()->currency != "" ? request()->currency : "NGN"), |
|
| 127 | 127 | |
| 128 | 128 | /* |
| 129 | 129 | Paystack allows for transactions to be split into a subaccount - |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | $this->response = $this->client->{strtolower($method)}( |
| 197 | - $this->baseUrl . $relativeUrl, |
|
| 197 | + $this->baseUrl.$relativeUrl, |
|
| 198 | 198 | ["body" => json_encode($body)] |
| 199 | 199 | ); |
| 200 | 200 | |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | |
| 239 | 239 | $relativeUrl = "/transaction/verify/{$transactionRef}"; |
| 240 | 240 | |
| 241 | - $this->response = $this->client->get($this->baseUrl . $relativeUrl, []); |
|
| 241 | + $this->response = $this->client->get($this->baseUrl.$relativeUrl, []); |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | /** |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | public function fetchPlan($plan_code) |
| 386 | 386 | { |
| 387 | 387 | $this->setRequestOptions(); |
| 388 | - return $this->setHttpResponse('/plan/' . $plan_code, 'GET', [])->getResponse(); |
|
| 388 | + return $this->setHttpResponse('/plan/'.$plan_code, 'GET', [])->getResponse(); |
|
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | /** |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | ]; |
| 407 | 407 | |
| 408 | 408 | $this->setRequestOptions(); |
| 409 | - return $this->setHttpResponse('/plan/' . $plan_code, 'PUT', $data)->getResponse(); |
|
| 409 | + return $this->setHttpResponse('/plan/'.$plan_code, 'PUT', $data)->getResponse(); |
|
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | /** |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | public function fetchCustomer($customer_id) |
| 436 | 436 | { |
| 437 | 437 | $this->setRequestOptions(); |
| 438 | - return $this->setHttpResponse('/customer/' . $customer_id, 'GET', [])->getResponse(); |
|
| 438 | + return $this->setHttpResponse('/customer/'.$customer_id, 'GET', [])->getResponse(); |
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | /** |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | ]; |
| 456 | 456 | |
| 457 | 457 | $this->setRequestOptions(); |
| 458 | - return $this->setHttpResponse('/customer/' . $customer_id, 'PUT', $data)->getResponse(); |
|
| 458 | + return $this->setHttpResponse('/customer/'.$customer_id, 'PUT', $data)->getResponse(); |
|
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | /** |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | { |
| 512 | 512 | $this->setRequestOptions(); |
| 513 | 513 | |
| 514 | - return $this->setHttpResponse('/subscription?customer=' . $customer_id, 'GET', [])->getData(); |
|
| 514 | + return $this->setHttpResponse('/subscription?customer='.$customer_id, 'GET', [])->getData(); |
|
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | /** |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | { |
| 525 | 525 | $this->setRequestOptions(); |
| 526 | 526 | |
| 527 | - return $this->setHttpResponse('/subscription?plan=' . $plan_id, 'GET', [])->getData(); |
|
| 527 | + return $this->setHttpResponse('/subscription?plan='.$plan_id, 'GET', [])->getData(); |
|
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | /** |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | public function fetchSubscription($subscription_id) |
| 566 | 566 | { |
| 567 | 567 | $this->setRequestOptions(); |
| 568 | - return $this->setHttpResponse('/subscription/' . $subscription_id, 'GET', [])->getResponse(); |
|
| 568 | + return $this->setHttpResponse('/subscription/'.$subscription_id, 'GET', [])->getResponse(); |
|
| 569 | 569 | } |
| 570 | 570 | |
| 571 | 571 | /** |
@@ -601,7 +601,7 @@ discard block |
||
| 601 | 601 | public function fetchPage($page_id) |
| 602 | 602 | { |
| 603 | 603 | $this->setRequestOptions(); |
| 604 | - return $this->setHttpResponse('/page/' . $page_id, 'GET', [])->getResponse(); |
|
| 604 | + return $this->setHttpResponse('/page/'.$page_id, 'GET', [])->getResponse(); |
|
| 605 | 605 | } |
| 606 | 606 | |
| 607 | 607 | /** |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | ]; |
| 619 | 619 | |
| 620 | 620 | $this->setRequestOptions(); |
| 621 | - return $this->setHttpResponse('/page/' . $page_id, 'PUT', $data)->getResponse(); |
|
| 621 | + return $this->setHttpResponse('/page/'.$page_id, 'PUT', $data)->getResponse(); |
|
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | /** |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | { |
| 667 | 667 | |
| 668 | 668 | $this->setRequestOptions(); |
| 669 | - return $this->setHttpResponse("/subaccount/?perPage=" . (int) $per_page . "&page=" . (int) $page, "GET")->getResponse(); |
|
| 669 | + return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page, "GET")->getResponse(); |
|
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | |