Completed
Pull Request — master (#77)
by
unknown
11:02
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,
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                 "plan" => request()->plan,
120 120
                 "first_name" => request()->first_name,
121 121
                 "last_name" => request()->last_name,
122
-                "currency" => (request()->currency != ""  ? request()->currency : "NGN"),
122
+                "currency" => (request()->currency != "" ? request()->currency : "NGN"),
123 123
                 "callback_url" => request()->callback_url,
124 124
                 /*
125 125
                 * to allow use of metadata on Paystack dashboard and a means to return additional data back to redirect url
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         }
162 162
 
163 163
         $this->response = $this->client->{strtolower($method)}(
164
-            $this->baseUrl . $relativeUrl,
164
+            $this->baseUrl.$relativeUrl,
165 165
             ["body" => json_encode($body)]
166 166
         );
167 167
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 
206 206
         $relativeUrl = "/transaction/verify/{$transactionRef}";
207 207
 
208
-        $this->response = $this->client->get($this->baseUrl . $relativeUrl, []);
208
+        $this->response = $this->client->get($this->baseUrl.$relativeUrl, []);
209 209
     }
210 210
 
211 211
     /**
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
     public function fetchPlan($plan_code)
354 354
     {
355 355
         $this->setRequestOptions();
356
-        return $this->setHttpResponse('/plan/' . $plan_code, 'GET', [])->getResponse();
356
+        return $this->setHttpResponse('/plan/'.$plan_code, 'GET', [])->getResponse();
357 357
     }
358 358
 
359 359
     /**
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
         ];
375 375
 
376 376
         $this->setRequestOptions();
377
-        return $this->setHttpResponse('/plan/' . $plan_code, 'PUT', $data)->getResponse();
377
+        return $this->setHttpResponse('/plan/'.$plan_code, 'PUT', $data)->getResponse();
378 378
     }
379 379
 
380 380
     /**
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,
@@ -618,10 +618,10 @@  discard block
 block discarded – undo
618 618
      * @param subaccount code
619 619
      * @return array
620 620
      */
621
-    public function fetchSubAccount($subaccount_code){
621
+    public function fetchSubAccount($subaccount_code) {
622 622
 
623 623
         $this->setRequestOptions();
624
-        return $this->setHttpResponse("/subaccount/{$subaccount_code}","GET",[])->getResponse();
624
+        return $this->setHttpResponse("/subaccount/{$subaccount_code}", "GET", [])->getResponse();
625 625
 
626 626
     }
627 627
 
@@ -630,10 +630,10 @@  discard block
 block discarded – undo
630 630
      * @param $per_page - Specifies how many records to retrieve per page , $page - SPecifies exactly what page to retrieve
631 631
      * @return array
632 632
      */
633
-    public function listSubAccounts($per_page,$page){
633
+    public function listSubAccounts($per_page, $page) {
634 634
 
635 635
         $this->setRequestOptions();
636
-        return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page,"GET")->getResponse();
636
+        return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page, "GET")->getResponse();
637 637
 
638 638
     }
639 639
 
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
      * @return array
645 645
      */
646 646
     
647
-    public function updateSubAccount($subaccount_code){
647
+    public function updateSubAccount($subaccount_code) {
648 648
         $data = [
649 649
             "business_name" => request()->business_name, 
650 650
             "settlement_bank" => request()->settlement_bank,
Please login to merge, or discard this patch.