Completed
Pull Request — master (#154)
by
unknown
47s
created
src/Paystack.php 1 patch
Spacing   +17 added lines, -17 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
             [
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
     public function makePaymentRequest($data = null)
113 113
     {
114
-        if ( $data == null ) {
114
+        if ($data == null) {
115 115
 
116 116
             $quantity = intval(request()->quantity ?? 1);
117 117
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     /**
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
     public function fetchPlan($plan_code)
387 387
     {
388 388
         $this->setRequestOptions();
389
-        return $this->setHttpResponse('/plan/' . $plan_code, 'GET', [])->getResponse();
389
+        return $this->setHttpResponse('/plan/'.$plan_code, 'GET', [])->getResponse();
390 390
     }
391 391
 
392 392
     /**
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
         ];
408 408
 
409 409
         $this->setRequestOptions();
410
-        return $this->setHttpResponse('/plan/' . $plan_code, 'PUT', $data)->getResponse();
410
+        return $this->setHttpResponse('/plan/'.$plan_code, 'PUT', $data)->getResponse();
411 411
     }
412 412
 
413 413
     /**
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
     public function fetchCustomer($customer_id)
437 437
     {
438 438
         $this->setRequestOptions();
439
-        return $this->setHttpResponse('/customer/'. $customer_id, 'GET', [])->getResponse();
439
+        return $this->setHttpResponse('/customer/'.$customer_id, 'GET', [])->getResponse();
440 440
     }
441 441
 
442 442
     /**
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
         ];
457 457
 
458 458
         $this->setRequestOptions();
459
-        return $this->setHttpResponse('/customer/'. $customer_id, 'PUT', $data)->getResponse();
459
+        return $this->setHttpResponse('/customer/'.$customer_id, 'PUT', $data)->getResponse();
460 460
     }
461 461
 
462 462
     /**
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
     {
513 513
         $this->setRequestOptions();
514 514
 
515
-        return $this->setHttpResponse('/subscription?customer=' . $customer_id, 'GET', [])->getData();
515
+        return $this->setHttpResponse('/subscription?customer='.$customer_id, 'GET', [])->getData();
516 516
     }
517 517
 
518 518
     /**
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
     {
526 526
         $this->setRequestOptions();
527 527
 
528
-        return $this->setHttpResponse('/subscription?plan=' . $plan_id, 'GET', [])->getData();
528
+        return $this->setHttpResponse('/subscription?plan='.$plan_id, 'GET', [])->getData();
529 529
     }
530 530
 
531 531
     /**
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
      * @return array
629 629
      */
630 630
 
631
-    public function createSubAccount(){
631
+    public function createSubAccount() {
632 632
         $data = [
633 633
             "business_name" => request()->business_name,
634 634
             "settlement_bank" => request()->settlement_bank,
@@ -651,10 +651,10 @@  discard block
 block discarded – undo
651 651
      * @param subaccount code
652 652
      * @return array
653 653
      */
654
-    public function fetchSubAccount($subaccount_code){
654
+    public function fetchSubAccount($subaccount_code) {
655 655
 
656 656
         $this->setRequestOptions();
657
-        return $this->setHttpResponse("/subaccount/{$subaccount_code}","GET",[])->getResponse();
657
+        return $this->setHttpResponse("/subaccount/{$subaccount_code}", "GET", [])->getResponse();
658 658
 
659 659
     }
660 660
 
@@ -663,10 +663,10 @@  discard block
 block discarded – undo
663 663
      * @param $per_page - Specifies how many records to retrieve per page , $page - SPecifies exactly what page to retrieve
664 664
      * @return array
665 665
      */
666
-    public function listSubAccounts($per_page,$page){
666
+    public function listSubAccounts($per_page, $page) {
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
 
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
      * @return array
678 678
      */
679 679
 
680
-    public function updateSubAccount($subaccount_code){
680
+    public function updateSubAccount($subaccount_code) {
681 681
         $data = [
682 682
             "business_name" => request()->business_name,
683 683
             "settlement_bank" => request()->settlement_bank,
Please login to merge, or discard this patch.