@@ -739,7 +739,7 @@ function synergywholesaledomains_Sync(array $params)
739
739
{
740
740
// Run the sync command on the domain specified
741
741
try {
742
- $ response = synergywholesaledomains_apiRequest ('domainInfo ' , $ params );
742
+ $ response = synergywholesaledomains_apiRequest ('domainInfo ' , $ params, [], false );
743
743
} catch (\Exception $ e ) {
744
744
return [
745
745
'error ' => $ e ->getMessage (),
@@ -751,13 +751,15 @@ function synergywholesaledomains_Sync(array $params)
751
751
->first ();
752
752
753
753
// Sync ID Protection
754
- $ idProtect = $ response ['idProtect ' ] === 'Enabled ' ;
755
- if ($ domain ->idprotection != $ idProtect ) {
756
- Capsule::table ('tbldomains ' )
757
- ->where ('id ' , $ params ['domainid ' ])
758
- ->update ([
759
- 'idprotection ' => (int ) $ idProtect ,
760
- ]);
754
+ if (isset ($ response ['idProtect ' ])) {
755
+ $ idProtect = $ response ['idProtect ' ] === 'Enabled ' ;
756
+ if ($ domain ->idprotection != $ idProtect ) {
757
+ Capsule::table ('tbldomains ' )
758
+ ->where ('id ' , $ params ['domainid ' ])
759
+ ->update ([
760
+ 'idprotection ' => (int ) $ idProtect ,
761
+ ]);
762
+ }
761
763
}
762
764
763
765
try {
@@ -875,7 +877,7 @@ function synergywholesaledomains_Sync(array $params)
875
877
->first ();
876
878
// If the domain used to exist in this whmcs installation it's safe to say if we get these errors then
877
879
// it has been transferred away to another reseller
878
- if ('Domain Info Failed - Unable to retrieve domain id ' === $ response ['errorMessage ' ]) {
880
+ if ('Domain Info Failed - Unable to retrieve domain id ' === $ response ['error ' ]) {
879
881
// If now is after the domains expiry date mark it as cancelled
880
882
if (time () >= strtotime ($ selectInfo ->expirydate )) {
881
883
$ note = 'Domain has been marked as cancelled due to not being in your account and, the current date is past the expiry date ' ;
@@ -2350,7 +2352,7 @@ function synergywholesaledomains_adhocTransferSync(array $params, $domainInfo)
2350
2352
* because the interface has the data fetched prior to this function running.
2351
2353
*
2352
2354
* @param array $params The parameters
2353
- * @param object $domainInfo The domain information
2355
+ * @param object $domainInfo The domain information from the DB
2354
2356
*
2355
2357
* @return array Returns a message containing the updated information.
2356
2358
*/
0 commit comments