Completed
Push — master ( a37060...378310 )
by PROSPER
02:03 queued 52s
created
src/PaystackServiceProvider.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
     protected $defer = false;
25 25
 
26 26
     /**
27
-    * Publishes all the config file this package needs to function
28
-    */
27
+     * Publishes all the config file this package needs to function
28
+     */
29 29
     public function boot()
30 30
     {
31 31
         $config = realpath(__DIR__.'/../resources/config/paystack.php');
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
     }
37 37
 
38 38
     /**
39
-    * Register the application services.
40
-    */
39
+     * Register the application services.
40
+     */
41 41
     public function register()
42 42
     {
43 43
         $this->app->bind('laravel-paystack', function () {
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
     }
49 49
 
50 50
     /**
51
-    * Get the services provided by the provider
52
-    * @return array
53
-    */
51
+     * Get the services provided by the provider
52
+     * @return array
53
+     */
54 54
     public function provides()
55 55
     {
56 56
         return ['laravel-paystack'];
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
     */
41 41
     public function register()
42 42
     {
43
-        $this->app->bind('laravel-paystack', function () {
43
+        $this->app->bind('laravel-paystack', function() {
44 44
 
45 45
             return new Paystack;
46 46
 
Please login to merge, or discard this patch.
src/Paystack.php 2 patches
Indentation   +22 added lines, -23 removed lines patch added patch discarded remove patch
@@ -102,12 +102,11 @@  discard block
 block discarded – undo
102 102
 
103 103
 
104 104
      /**
105
-
106
-     * Initiate a payment request to Paystack
107
-     * Included the option to pass the payload to this method for situations
108
-     * when the payload is built on the fly (not passed to the controller from a view)
109
-     * @return Paystack
110
-     */
105
+      * Initiate a payment request to Paystack
106
+      * Included the option to pass the payload to this method for situations
107
+      * when the payload is built on the fly (not passed to the controller from a view)
108
+      * @return Paystack
109
+      */
111 110
 
112 111
     public function makePaymentRequest( $data = null)
113 112
     {
@@ -189,11 +188,11 @@  discard block
 block discarded – undo
189 188
     }
190 189
 
191 190
      /**
192
-     * Get the authorization callback response
193
-     * In situations where Laravel serves as an backend for a detached UI, the api cannot redirect
194
-     * and might need to take different actions based on the success or not of the transaction
195
-     * @return array
196
-     */
191
+      * Get the authorization callback response
192
+      * In situations where Laravel serves as an backend for a detached UI, the api cannot redirect
193
+      * and might need to take different actions based on the success or not of the transaction
194
+      * @return array
195
+      */
197 196
     public function getAuthorizationResponse($data)
198 197
     {
199 198
         $this->makePaymentRequest($data);
@@ -597,10 +596,10 @@  discard block
 block discarded – undo
597 596
     }
598 597
 
599 598
      /**
600
-     * Creates a subaccount to be used for split payments . Required    params are business_name , settlement_bank , account_number ,   percentage_charge
601
-     *
602
-     * @return array
603
-     */
599
+      * Creates a subaccount to be used for split payments . Required    params are business_name , settlement_bank , account_number ,   percentage_charge
600
+      *
601
+      * @return array
602
+      */
604 603
 
605 604
     public function createSubAccount(){
606 605
         $data = [
@@ -621,10 +620,10 @@  discard block
 block discarded – undo
621 620
     }
622 621
 
623 622
      /**
624
-     * Fetches details of a subaccount
625
-     * @param subaccount code
626
-     * @return array
627
-     */
623
+      * Fetches details of a subaccount
624
+      * @param subaccount code
625
+      * @return array
626
+      */
628 627
     public function fetchSubAccount($subaccount_code){
629 628
 
630 629
         $this->setRequestOptions();
@@ -633,10 +632,10 @@  discard block
 block discarded – undo
633 632
     }
634 633
 
635 634
      /**
636
-     * Lists all the subaccounts associated with the account
637
-     * @param $per_page - Specifies how many records to retrieve per page , $page - SPecifies exactly what page to retrieve
638
-     * @return array
639
-     */
635
+      * Lists all the subaccounts associated with the account
636
+      * @param $per_page - Specifies how many records to retrieve per page , $page - SPecifies exactly what page to retrieve
637
+      * @return array
638
+      */
640 639
     public function listSubAccounts($per_page,$page){
641 640
 
642 641
         $this->setRequestOptions();
Please login to merge, or discard this 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.
src/Support/helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! function_exists("paystack"))
3
+if (!function_exists("paystack"))
4 4
 {
5 5
     function paystack() {
6 6
 
Please login to merge, or discard this patch.