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