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()
|
public function syncCompaniesFromSentri()
|
||||||
{
|
{
|
||||||
# init the cloudDistributor name
|
# init the cloudDistributor name
|
||||||
|
|
||||||
if (!isset($this->inserve_custom_data['cloudDistributor']) || $this->inserve_custom_data['cloudDistributor'] === '') {
|
if (!isset($this->inserve_custom_data['cloudDistributor']) || $this->inserve_custom_data['cloudDistributor'] === '') {
|
||||||
$this->apiOutput(400, ['error' => 'missing cloudDistributor in custom source data']);
|
$this->apiOutput(400, ['error' => 'missing cloudDistributor in custom source data']);
|
||||||
} else {
|
} else {
|
||||||
@@ -474,7 +475,6 @@ class API_inserve extends API
|
|||||||
}
|
}
|
||||||
unset($item);
|
unset($item);
|
||||||
|
|
||||||
|
|
||||||
foreach ($subscriptionCounts as $key => $item) {
|
foreach ($subscriptionCounts as $key => $item) {
|
||||||
// if subscriptionInserveExists but the countInserve is null skip creation
|
// if subscriptionInserveExists but the countInserve is null skip creation
|
||||||
if ($item['subscriptionInserveExists'] === false && (int)$item['countSentri'] === 0) {
|
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
|
"cloud_subscription_id" => "sentri-servers", # Mark all the sentri-servers subscriptions so we can filter the subscriptions better
|
||||||
"name" => $item['subscriptionSentriName'],
|
"name" => $item['subscriptionSentriName'],
|
||||||
"quantity" => ($row['server_state'] === 'deleted') ? 0 : $item['countSentri'],
|
"quantity" => ($row['server_state'] === 'deleted') ? 0 : $item['countSentri'],
|
||||||
|
"cloud_distributor" => $this->cloudDistributor,
|
||||||
"cloud_distribution_company_id" => $item['sentriCompanyId'], # this is generated by inserve
|
"cloud_distribution_company_id" => $item['sentriCompanyId'], # this is generated by inserve
|
||||||
"status" => $item['SentriStatus'],
|
"status" => $item['SentriStatus'],
|
||||||
"period_type" => 0, # 0 = monthly, 1 = annual, 2 = one time cost
|
"period_type" => 0, # 0 = monthly, 1 = annual, 2 = one time cost
|
||||||
@@ -511,6 +512,7 @@ class API_inserve extends API
|
|||||||
) {
|
) {
|
||||||
$payload = [
|
$payload = [
|
||||||
"quantity" => ($row['server_state'] === 'deleted') ? 0 : $item['countSentri'],
|
"quantity" => ($row['server_state'] === 'deleted') ? 0 : $item['countSentri'],
|
||||||
|
"cloud_distributor" => $this->cloudDistributor,
|
||||||
"cloud_distribution_company_id" => (int)$item['sentriCompanyId'],
|
"cloud_distribution_company_id" => (int)$item['sentriCompanyId'],
|
||||||
"name" => $item['subscriptionSentriName'],
|
"name" => $item['subscriptionSentriName'],
|
||||||
"status" => $item['SentriStatus']
|
"status" => $item['SentriStatus']
|
||||||
|
|||||||
Reference in New Issue
Block a user