Skip to content

Commit

Permalink
Do not return cancelled if the domain isn't active
Browse files Browse the repository at this point in the history
This allows WHMCS to handle statuses from the various stages of expiry, like expired, expired grace, etc.
Note: the $code === 200 conditional on line 1380 handles the truly necessary cases to force a cancelled status.
Fixes namesilo#3
  • Loading branch information
jas8522 authored Nov 16, 2021
1 parent 4d6eaa5 commit ef376de
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions namesilo.php
Original file line number Diff line number Diff line change
Expand Up @@ -1399,14 +1399,16 @@ function namesilo_Sync($params)
}

$status = (string)$result->status;
$active = $status === 'Active' ? true : false;

return [
'active' => $active,
'cancelled' => !$active,
'transferredAway' => false,
'expirydate' => (string)$result->expires,
];

if ($status === 'Active'){
return [
'active' => true,
'expirydate' => (string)$result->expires,
];
}
else{
return ['active' => false ]; //expired
}

} catch (\Throwable $e) {
return ['error' => 'ERROR: ' . $domainName . ' - ' . $e->getMessage()];
Expand Down

0 comments on commit ef376de

Please sign in to comment.