@@ -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 | /** |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | /** |
327 | 327 | * Create a plan |
328 | 328 | */ |
329 | - public function createPlan( $data = null ) |
|
329 | + public function createPlan($data = null) |
|
330 | 330 | { |
331 | 331 | if ($data == null) { |
332 | 332 | $data = [ |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | public function fetchPlan($plan_code) |
355 | 355 | { |
356 | 356 | $this->setRequestOptions(); |
357 | - return $this->setHttpResponse('/plan/' . $plan_code, 'GET', [])->getResponse(); |
|
357 | + return $this->setHttpResponse('/plan/'.$plan_code, 'GET', [])->getResponse(); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | /** |
@@ -377,15 +377,15 @@ discard block |
||
377 | 377 | } |
378 | 378 | |
379 | 379 | $this->setRequestOptions(); |
380 | - return $this->setHttpResponse('/plan/' . $plan_code, 'PUT', $data)->getResponse(); |
|
380 | + return $this->setHttpResponse('/plan/'.$plan_code, 'PUT', $data)->getResponse(); |
|
381 | 381 | } |
382 | 382 | |
383 | 383 | /** |
384 | 384 | * Create a customer |
385 | 385 | */ |
386 | - public function createCustomer( $data = null ) |
|
386 | + public function createCustomer($data = null) |
|
387 | 387 | { |
388 | - if ($data == null){ |
|
388 | + if ($data == null) { |
|
389 | 389 | $data = [ |
390 | 390 | "email" => request()->email, |
391 | 391 | "first_name" => request()->fname, |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | public function fetchCustomer($customer_id) |
408 | 408 | { |
409 | 409 | $this->setRequestOptions(); |
410 | - return $this->setHttpResponse('/customer/'. $customer_id, 'GET', [])->getResponse(); |
|
410 | + return $this->setHttpResponse('/customer/'.$customer_id, 'GET', [])->getResponse(); |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | /** |
@@ -429,14 +429,14 @@ discard block |
||
429 | 429 | } |
430 | 430 | |
431 | 431 | $this->setRequestOptions(); |
432 | - return $this->setHttpResponse('/customer/'. $customer_id, 'PUT', $data)->getResponse(); |
|
432 | + return $this->setHttpResponse('/customer/'.$customer_id, 'PUT', $data)->getResponse(); |
|
433 | 433 | } |
434 | 434 | |
435 | 435 | /** |
436 | 436 | * Export transactions in .CSV |
437 | 437 | * @return array |
438 | 438 | */ |
439 | - public function exportTransactions( $data = null ) |
|
439 | + public function exportTransactions($data = null) |
|
440 | 440 | { |
441 | 441 | if ($data == null) { |
442 | 442 | $data = [ |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | { |
488 | 488 | $this->setRequestOptions(); |
489 | 489 | |
490 | - return $this->setHttpResponse('/subscription?customer=' . $customer_id, 'GET', [])->getData(); |
|
490 | + return $this->setHttpResponse('/subscription?customer='.$customer_id, 'GET', [])->getData(); |
|
491 | 491 | } |
492 | 492 | |
493 | 493 | /** |
@@ -500,14 +500,14 @@ discard block |
||
500 | 500 | { |
501 | 501 | $this->setRequestOptions(); |
502 | 502 | |
503 | - return $this->setHttpResponse('/subscription?plan=' . $plan_id, 'GET', [])->getData(); |
|
503 | + return $this->setHttpResponse('/subscription?plan='.$plan_id, 'GET', [])->getData(); |
|
504 | 504 | } |
505 | 505 | |
506 | 506 | /** |
507 | 507 | * Enable a subscription using the subscription code and token |
508 | 508 | * @return array |
509 | 509 | */ |
510 | - public function enableSubscription( $data = null ) |
|
510 | + public function enableSubscription($data = null) |
|
511 | 511 | { |
512 | 512 | if ($data == null) { |
513 | 513 | $data = [ |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | * @return array |
606 | 606 | */ |
607 | 607 | |
608 | - public function createSubAccount( $data = null ){ |
|
608 | + public function createSubAccount($data = null) { |
|
609 | 609 | |
610 | 610 | if ($data == null) { |
611 | 611 | $data = [ |
@@ -632,10 +632,10 @@ discard block |
||
632 | 632 | * @param subaccount code |
633 | 633 | * @return array |
634 | 634 | */ |
635 | - public function fetchSubAccount($subaccount_code){ |
|
635 | + public function fetchSubAccount($subaccount_code) { |
|
636 | 636 | |
637 | 637 | $this->setRequestOptions(); |
638 | - return $this->setHttpResponse("/subaccount/{$subaccount_code}","GET",[])->getResponse(); |
|
638 | + return $this->setHttpResponse("/subaccount/{$subaccount_code}", "GET", [])->getResponse(); |
|
639 | 639 | |
640 | 640 | } |
641 | 641 | |
@@ -644,10 +644,10 @@ discard block |
||
644 | 644 | * @param $per_page - Specifies how many records to retrieve per page , $page - SPecifies exactly what page to retrieve |
645 | 645 | * @return array |
646 | 646 | */ |
647 | - public function listSubAccounts($per_page,$page){ |
|
647 | + public function listSubAccounts($per_page, $page) { |
|
648 | 648 | |
649 | 649 | $this->setRequestOptions(); |
650 | - return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page,"GET")->getResponse(); |
|
650 | + return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page, "GET")->getResponse(); |
|
651 | 651 | |
652 | 652 | } |
653 | 653 | |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | * @return array |
659 | 659 | */ |
660 | 660 | |
661 | - public function updateSubAccount($subaccount_code, $data = null){ |
|
661 | + public function updateSubAccount($subaccount_code, $data = null) { |
|
662 | 662 | if ($data == null) { |
663 | 663 | $data = [ |
664 | 664 | "business_name" => request()->business_name, |