diff --git a/pub/api/classes/API_inserve.php b/pub/api/classes/API_inserve.php index b399a13..e7390ff 100644 --- a/pub/api/classes/API_inserve.php +++ b/pub/api/classes/API_inserve.php @@ -126,6 +126,7 @@ class API_inserve extends API public function syncCompaniesFromSentri() { # init the cloudDistributor name + if (!isset($this->inserve_custom_data['cloudDistributor']) || $this->inserve_custom_data['cloudDistributor'] === '') { $this->apiOutput(400, ['error' => 'missing cloudDistributor in custom source data']); } else { @@ -474,7 +475,6 @@ class API_inserve extends API } unset($item); - foreach ($subscriptionCounts as $key => $item) { // if subscriptionInserveExists but the countInserve is null skip creation if ($item['subscriptionInserveExists'] === false && (int)$item['countSentri'] === 0) { @@ -488,6 +488,7 @@ class API_inserve extends API "cloud_subscription_id" => "sentri-servers", # Mark all the sentri-servers subscriptions so we can filter the subscriptions better "name" => $item['subscriptionSentriName'], "quantity" => ($row['server_state'] === 'deleted') ? 0 : $item['countSentri'], + "cloud_distributor" => $this->cloudDistributor, "cloud_distribution_company_id" => $item['sentriCompanyId'], # this is generated by inserve "status" => $item['SentriStatus'], "period_type" => 0, # 0 = monthly, 1 = annual, 2 = one time cost @@ -511,6 +512,7 @@ class API_inserve extends API ) { $payload = [ "quantity" => ($row['server_state'] === 'deleted') ? 0 : $item['countSentri'], + "cloud_distributor" => $this->cloudDistributor, "cloud_distribution_company_id" => (int)$item['sentriCompanyId'], "name" => $item['subscriptionSentriName'], "status" => $item['SentriStatus'] @@ -759,4 +761,4 @@ class API_inserve extends API $this->execCurl(); } -} \ No newline at end of file +}