Completed
Pull Request — master (#79)
by
unknown
01:20
created
src/Paystack.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     /**
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 
341 341
         $this->setRequestOptions();
342 342
 
343
-        $this->setHttpResponse("/plan", 'POST', $data)->getResponse();;
343
+        $this->setHttpResponse("/plan", 'POST', $data)->getResponse(); ;
344 344
 
345 345
     }
346 346
 
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     /**
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
     public function fetchCustomer($customer_id)
403 403
     {
404 404
         $this->setRequestOptions();
405
-        return $this->setHttpResponse('/customer/'. $customer_id, 'GET', [])->getResponse();
405
+        return $this->setHttpResponse('/customer/'.$customer_id, 'GET', [])->getResponse();
406 406
     }
407 407
 
408 408
     /**
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         ];
423 423
 
424 424
         $this->setRequestOptions();
425
-        return $this->setHttpResponse('/customer/'. $customer_id, 'PUT', $data)->getResponse();
425
+        return $this->setHttpResponse('/customer/'.$customer_id, 'PUT', $data)->getResponse();
426 426
     }
427 427
 
428 428
     /**
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
     {
479 479
         $this->setRequestOptions();
480 480
 
481
-        return $this->setHttpResponse('/subscription?customer=' . $customer_id, 'GET', [])->getData();
481
+        return $this->setHttpResponse('/subscription?customer='.$customer_id, 'GET', [])->getData();
482 482
     }
483 483
 
484 484
     /**
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
     {
492 492
         $this->setRequestOptions();
493 493
 
494
-        return $this->setHttpResponse('/subscription?plan=' . $plan_id, 'GET', [])->getData();
494
+        return $this->setHttpResponse('/subscription?plan='.$plan_id, 'GET', [])->getData();
495 495
     }
496 496
 
497 497
     /**
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
      * @return array
595 595
      */
596 596
     
597
-    public function createSubAccount(){
597
+    public function createSubAccount() {
598 598
         $data = [
599 599
             "business_name" => request()->business_name, 
600 600
             "settlement_bank" => request()->settlement_bank,
@@ -617,10 +617,10 @@  discard block
 block discarded – undo
617 617
      * @param subaccount code
618 618
      * @return array
619 619
      */
620
-    public function fetchSubAccount($subaccount_code){
620
+    public function fetchSubAccount($subaccount_code) {
621 621
 
622 622
         $this->setRequestOptions();
623
-        return $this->setHttpResponse("/subaccount/{$subaccount_code}","GET",[])->getResponse();
623
+        return $this->setHttpResponse("/subaccount/{$subaccount_code}", "GET", [])->getResponse();
624 624
 
625 625
     }
626 626
 
@@ -629,10 +629,10 @@  discard block
 block discarded – undo
629 629
      * @param $per_page - Specifies how many records to retrieve per page , $page - SPecifies exactly what page to retrieve
630 630
      * @return array
631 631
      */
632
-    public function listSubAccounts($per_page,$page){
632
+    public function listSubAccounts($per_page, $page) {
633 633
 
634 634
         $this->setRequestOptions();
635
-        return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page,"GET")->getResponse();
635
+        return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page, "GET")->getResponse();
636 636
 
637 637
     }
638 638
 
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
      * @return array
644 644
      */
645 645
     
646
-    public function updateSubAccount($subaccount_code){
646
+    public function updateSubAccount($subaccount_code) {
647 647
         $data = [
648 648
             "business_name" => request()->business_name, 
649 649
             "settlement_bank" => request()->settlement_bank,
Please login to merge, or discard this patch.