Completed
Push — master ( 1ba8a4...64bcc5 )
by PROSPER
07:18
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,
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                 "first_name" => request()->first_name,
121 121
                 "last_name" => request()->last_name,
122 122
                 "callback_url" => request()->callback_url,
123
-                "currency" => (request()->currency != ""  ? request()->currency : "NGN"),
123
+                "currency" => (request()->currency != "" ? request()->currency : "NGN"),
124 124
                 /*
125 125
                     Paystack allows for transactions to be split into a subaccount -
126 126
                     The following lines trap the subaccount ID - as well as the ammount to charge the subaccount (if overriden in the form)
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         }
169 169
 
170 170
         $this->response = $this->client->{strtolower($method)}(
171
-            $this->baseUrl . $relativeUrl,
171
+            $this->baseUrl.$relativeUrl,
172 172
             ["body" => json_encode($body)]
173 173
         );
174 174
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
         $relativeUrl = "/transaction/verify/{$transactionRef}";
214 214
 
215
-        $this->response = $this->client->get($this->baseUrl . $relativeUrl, []);
215
+        $this->response = $this->client->get($this->baseUrl.$relativeUrl, []);
216 216
     }
217 217
 
218 218
     /**
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
     public function fetchPlan($plan_code)
361 361
     {
362 362
         $this->setRequestOptions();
363
-        return $this->setHttpResponse('/plan/' . $plan_code, 'GET', [])->getResponse();
363
+        return $this->setHttpResponse('/plan/'.$plan_code, 'GET', [])->getResponse();
364 364
     }
365 365
 
366 366
     /**
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
         ];
382 382
 
383 383
         $this->setRequestOptions();
384
-        return $this->setHttpResponse('/plan/' . $plan_code, 'PUT', $data)->getResponse();
384
+        return $this->setHttpResponse('/plan/'.$plan_code, 'PUT', $data)->getResponse();
385 385
     }
386 386
 
387 387
     /**
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
     public function fetchCustomer($customer_id)
411 411
     {
412 412
         $this->setRequestOptions();
413
-        return $this->setHttpResponse('/customer/'. $customer_id, 'GET', [])->getResponse();
413
+        return $this->setHttpResponse('/customer/'.$customer_id, 'GET', [])->getResponse();
414 414
     }
415 415
 
416 416
     /**
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
         ];
431 431
 
432 432
         $this->setRequestOptions();
433
-        return $this->setHttpResponse('/customer/'. $customer_id, 'PUT', $data)->getResponse();
433
+        return $this->setHttpResponse('/customer/'.$customer_id, 'PUT', $data)->getResponse();
434 434
     }
435 435
 
436 436
     /**
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
     {
487 487
         $this->setRequestOptions();
488 488
 
489
-        return $this->setHttpResponse('/subscription?customer=' . $customer_id, 'GET', [])->getData();
489
+        return $this->setHttpResponse('/subscription?customer='.$customer_id, 'GET', [])->getData();
490 490
     }
491 491
 
492 492
     /**
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
     {
500 500
         $this->setRequestOptions();
501 501
 
502
-        return $this->setHttpResponse('/subscription?plan=' . $plan_id, 'GET', [])->getData();
502
+        return $this->setHttpResponse('/subscription?plan='.$plan_id, 'GET', [])->getData();
503 503
     }
504 504
 
505 505
     /**
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
      * @return array
603 603
      */
604 604
 
605
-    public function createSubAccount(){
605
+    public function createSubAccount() {
606 606
         $data = [
607 607
             "business_name" => request()->business_name,
608 608
             "settlement_bank" => request()->settlement_bank,
@@ -625,10 +625,10 @@  discard block
 block discarded – undo
625 625
      * @param subaccount code
626 626
      * @return array
627 627
      */
628
-    public function fetchSubAccount($subaccount_code){
628
+    public function fetchSubAccount($subaccount_code) {
629 629
 
630 630
         $this->setRequestOptions();
631
-        return $this->setHttpResponse("/subaccount/{$subaccount_code}","GET",[])->getResponse();
631
+        return $this->setHttpResponse("/subaccount/{$subaccount_code}", "GET", [])->getResponse();
632 632
 
633 633
     }
634 634
 
@@ -637,10 +637,10 @@  discard block
 block discarded – undo
637 637
      * @param $per_page - Specifies how many records to retrieve per page , $page - SPecifies exactly what page to retrieve
638 638
      * @return array
639 639
      */
640
-    public function listSubAccounts($per_page,$page){
640
+    public function listSubAccounts($per_page, $page) {
641 641
 
642 642
         $this->setRequestOptions();
643
-        return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page,"GET")->getResponse();
643
+        return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page, "GET")->getResponse();
644 644
 
645 645
     }
646 646
 
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
      * @return array
652 652
      */
653 653
 
654
-    public function updateSubAccount($subaccount_code){
654
+    public function updateSubAccount($subaccount_code) {
655 655
         $data = [
656 656
             "business_name" => request()->business_name,
657 657
             "settlement_bank" => request()->settlement_bank,
Please login to merge, or discard this patch.