Completed
Push — master ( a37060...378310 )
by PROSPER
02:03 queued 52s
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
 
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
                     Paystack allows for transactions to be split into a subaccount -
129 129
                     The following lines trap the subaccount ID - as well as the ammount to charge the subaccount (if overriden in the form)
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         }
172 172
 
173 173
         $this->response = $this->client->{strtolower($method)}(
174
-            $this->baseUrl . $relativeUrl,
174
+            $this->baseUrl.$relativeUrl,
175 175
             ["body" => json_encode($body)]
176 176
         );
177 177
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
         $relativeUrl = "/transaction/verify/{$transactionRef}";
217 217
 
218
-        $this->response = $this->client->get($this->baseUrl . $relativeUrl, []);
218
+        $this->response = $this->client->get($this->baseUrl.$relativeUrl, []);
219 219
     }
220 220
 
221 221
     /**
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
     public function fetchPlan($plan_code)
364 364
     {
365 365
         $this->setRequestOptions();
366
-        return $this->setHttpResponse('/plan/' . $plan_code, 'GET', [])->getResponse();
366
+        return $this->setHttpResponse('/plan/'.$plan_code, 'GET', [])->getResponse();
367 367
     }
368 368
 
369 369
     /**
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
         ];
385 385
 
386 386
         $this->setRequestOptions();
387
-        return $this->setHttpResponse('/plan/' . $plan_code, 'PUT', $data)->getResponse();
387
+        return $this->setHttpResponse('/plan/'.$plan_code, 'PUT', $data)->getResponse();
388 388
     }
389 389
 
390 390
     /**
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
     public function fetchCustomer($customer_id)
414 414
     {
415 415
         $this->setRequestOptions();
416
-        return $this->setHttpResponse('/customer/'. $customer_id, 'GET', [])->getResponse();
416
+        return $this->setHttpResponse('/customer/'.$customer_id, 'GET', [])->getResponse();
417 417
     }
418 418
 
419 419
     /**
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
         ];
434 434
 
435 435
         $this->setRequestOptions();
436
-        return $this->setHttpResponse('/customer/'. $customer_id, 'PUT', $data)->getResponse();
436
+        return $this->setHttpResponse('/customer/'.$customer_id, 'PUT', $data)->getResponse();
437 437
     }
438 438
 
439 439
     /**
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
     {
490 490
         $this->setRequestOptions();
491 491
 
492
-        return $this->setHttpResponse('/subscription?customer=' . $customer_id, 'GET', [])->getData();
492
+        return $this->setHttpResponse('/subscription?customer='.$customer_id, 'GET', [])->getData();
493 493
     }
494 494
 
495 495
     /**
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
     {
503 503
         $this->setRequestOptions();
504 504
 
505
-        return $this->setHttpResponse('/subscription?plan=' . $plan_id, 'GET', [])->getData();
505
+        return $this->setHttpResponse('/subscription?plan='.$plan_id, 'GET', [])->getData();
506 506
     }
507 507
 
508 508
     /**
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
      * @return array
606 606
      */
607 607
 
608
-    public function createSubAccount(){
608
+    public function createSubAccount() {
609 609
         $data = [
610 610
             "business_name" => request()->business_name,
611 611
             "settlement_bank" => request()->settlement_bank,
@@ -628,10 +628,10 @@  discard block
 block discarded – undo
628 628
      * @param subaccount code
629 629
      * @return array
630 630
      */
631
-    public function fetchSubAccount($subaccount_code){
631
+    public function fetchSubAccount($subaccount_code) {
632 632
 
633 633
         $this->setRequestOptions();
634
-        return $this->setHttpResponse("/subaccount/{$subaccount_code}","GET",[])->getResponse();
634
+        return $this->setHttpResponse("/subaccount/{$subaccount_code}", "GET", [])->getResponse();
635 635
 
636 636
     }
637 637
 
@@ -640,10 +640,10 @@  discard block
 block discarded – undo
640 640
      * @param $per_page - Specifies how many records to retrieve per page , $page - SPecifies exactly what page to retrieve
641 641
      * @return array
642 642
      */
643
-    public function listSubAccounts($per_page,$page){
643
+    public function listSubAccounts($per_page, $page) {
644 644
 
645 645
         $this->setRequestOptions();
646
-        return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page,"GET")->getResponse();
646
+        return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page, "GET")->getResponse();
647 647
 
648 648
     }
649 649
 
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
      * @return array
655 655
      */
656 656
 
657
-    public function updateSubAccount($subaccount_code){
657
+    public function updateSubAccount($subaccount_code) {
658 658
         $data = [
659 659
             "business_name" => request()->business_name,
660 660
             "settlement_bank" => request()->settlement_bank,
Please login to merge, or discard this patch.