diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b03a9c..aa919d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,12 +15,15 @@ Synergy Wholesale WHMCS Domains Module ### Removed - - ## 2.2.5 [Updated 11/08/2021] ### Fixed - Fixed Typo with Newline not getting interpreted - Fixed 'on sale' domain register pricing. +- Fixed domains sync with a Synergy status 'Pending Registration' getting set with wrong status within WHMCS + +### Changed +- Domains successfully registered will now automatically sync with Synergy ## 2.2.2 [Updated 12/03/2021] diff --git a/modules/registrars/synergywholesaledomains/hooks.php b/modules/registrars/synergywholesaledomains/hooks.php index 269c731..b2b6ed5 100644 --- a/modules/registrars/synergywholesaledomains/hooks.php +++ b/modules/registrars/synergywholesaledomains/hooks.php @@ -105,3 +105,13 @@ return $vars; } }); + +/* + * Sync the domain with what's on Synergy, This will fix issues with domains that get statuses like Pending Registration. + */ +add_hook('AfterRegistrarRegistration', 1, function ($vars) { + // Only fire for the SWS registrar module + if ($vars['params']['registrar'] == 'synergywholesaledomains') { + synergywholesaledomains_Sync($vars['params']); + } +}); \ No newline at end of file diff --git a/modules/registrars/synergywholesaledomains/synergywholesaledomains.php b/modules/registrars/synergywholesaledomains/synergywholesaledomains.php index 0fdb197..719a40d 100644 --- a/modules/registrars/synergywholesaledomains/synergywholesaledomains.php +++ b/modules/registrars/synergywholesaledomains/synergywholesaledomains.php @@ -938,6 +938,18 @@ function synergywholesaledomains_Sync(array $params) 'transferredAway' => true, ]; break; + case 'register_manual': + $returnData = [ + 'active' => false, + 'cancelled' => false, + 'transferredAway' => false, + ]; + Capsule::table('tbldomains') + ->where('id', $params['domainid']) + ->update([ + 'status' => 'Pending Registration', + ]); + break; default: $returnData = [ 'active' => true,