fix: cloudDistributor not set when creating inserve subscription licenses.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user