Skip to content

Commit 5f16cfe

Browse files
ALameLlamaLuke McMahon
and
Luke McMahon
authored
Bugfix/sw 1873 whmcs pending registration status does not work (#68)
* 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 <lukemcmahon96@gmail.com>
1 parent 38c06ab commit 5f16cfe

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@ Synergy Wholesale WHMCS Domains Module
1515
### Removed
1616
-
1717

18-
1918
## 2.2.5 [Updated 11/08/2021]
2019

2120
### Fixed
2221
- Fixed Typo with Newline not getting interpreted
2322
- Fixed 'on sale' domain register pricing.
23+
- Fixed domains sync with a Synergy status 'Pending Registration' getting set with wrong status within WHMCS
24+
25+
### Changed
26+
- Domains successfully registered will now automatically sync with Synergy
2427

2528
## 2.2.2 [Updated 12/03/2021]
2629

modules/registrars/synergywholesaledomains/hooks.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,13 @@
105105
return $vars;
106106
}
107107
});
108+
109+
/*
110+
* Sync the domain with what's on Synergy, This will fix issues with domains that get statuses like Pending Registration.
111+
*/
112+
add_hook('AfterRegistrarRegistration', 1, function ($vars) {
113+
// Only fire for the SWS registrar module
114+
if ($vars['params']['registrar'] == 'synergywholesaledomains') {
115+
synergywholesaledomains_Sync($vars['params']);
116+
}
117+
});

modules/registrars/synergywholesaledomains/synergywholesaledomains.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,18 @@ function synergywholesaledomains_Sync(array $params)
938938
'transferredAway' => true,
939939
];
940940
break;
941+
case 'register_manual':
942+
$returnData = [
943+
'active' => false,
944+
'cancelled' => false,
945+
'transferredAway' => false,
946+
];
947+
Capsule::table('tbldomains')
948+
->where('id', $params['domainid'])
949+
->update([
950+
'status' => 'Pending Registration',
951+
]);
952+
break;
941953
default:
942954
$returnData = [
943955
'active' => true,

0 commit comments

Comments
 (0)