Skip to content

Commit

Permalink
Bugfix/sw 1873 whmcs pending registration status does not work (#68)
Browse files Browse the repository at this point in the history
* Added support for register_manual status

* Added hook to fix register

* Added Changelog

* fixed bug

* removed unneeded code

* added registrar check

Co-authored-by: Luke McMahon <[email protected]>
  • Loading branch information
ALameLlama and Luke McMahon authored Aug 31, 2021
1 parent 38c06ab commit 5f16cfe
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
10 changes: 10 additions & 0 deletions modules/registrars/synergywholesaledomains/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5f16cfe

Please sign in to comment.