Bozhidar Slaveykov 1 jaar geleden
bovenliggende
commit
7ac497aab2

+ 7 - 0
web/app/ApiSDK/PhyreApiSDK.php

@@ -18,6 +18,13 @@ class PhyreApiSDK
         $this->username = $username;
         $this->username = $username;
     }
     }
 
 
+    public function getHostingSubscriptions()
+    {
+        $response = $this->sendRequest('hosting-subscriptions', [], 'GET');
+
+        return $response;
+    }
+
     public function getCustomers()
     public function getCustomers()
     {
     {
         $response = $this->sendRequest('customers', [], 'GET');
         $response = $this->sendRequest('customers', [], 'GET');

+ 2 - 2
web/app/Http/Controllers/Api/HostingSubscriptionsController.php

@@ -11,13 +11,13 @@ class HostingSubscriptionsController extends ApiController
 {
 {
     public function index()
     public function index()
     {
     {
-        $findHostingSubscription = HostingSubscription::all();
+        $findHostingSubscriptions = HostingSubscription::all();
 
 
         return response()->json([
         return response()->json([
             'status' => 'ok',
             'status' => 'ok',
             'message' => 'Hosting subscriptions found',
             'message' => 'Hosting subscriptions found',
             'data' => [
             'data' => [
-                'HostingSubscriptions' => $findHostingSubscription,
+                'hostingSubscriptions' => $findHostingSubscriptions,
             ],
             ],
         ]);
         ]);
 
 

+ 7 - 0
web/app/Models/PhyreServer.php

@@ -82,6 +82,13 @@ class PhyreServer extends Model
         }
         }
 
 
 
 
+        // Sync Hosting Subscriptions
+        $getExternalHostingSubscriptions = $phyreApiSDK->getHostingSubscriptions();
+        if (isset($getExternalHostingSubscriptions['data']['hostingSubscriptions'])) {
+            dd($getExternalHostingSubscriptions['data']['hostingSubscriptions']);
+        }
+        dd($getExternalHostingSubscriptions);
+
 
 
 //        // Sync Hosting Plans
 //        // Sync Hosting Plans
 //        $getHostingPlans = HostingPlan::all();
 //        $getHostingPlans = HostingPlan::all();