Jump to content

Enom Module Missing Renew (Extend) Command


PauloV

Recommended Posts

Hello :)

 

We have detected that eNom Module dosent renew domains :)

 

We have detected that because we had make Internet.BS module based on eNom and a client as discover the missing command :)

 

We will try to post here tomorow the command for enom to release on Blesta 3.3 ;)

 

Regards,

PV

 

 

Link to comment
Share on other sites

UPDATED 05--06-2015 (code corrected, bug was found by Tyson and applied on Blesta 3.5)

 

Here is the missing renew command coded, for enom module:

 

 

 

open file [blesta instalation directory]/components/modules/enom/enom.php

 

find on line 408:

	public function renewService($package, $service, $parent_package=null, $parent_service=null) {
		return null;
	}

replace with:

	public function renewService($package, $service, $parent_package=null, $parent_service=null) {
		$row = $this->getModuleRow($package->module_row);
		$api = $this->getApi($row->meta->user, $row->meta->key, $row->meta->sandbox == "true");

		// Renew domain
		if ($package->meta->type == "domain") {
			$fields = $this->serviceFieldsToObject($service->fields);

			$tld = trim($this->getTld($fields->domain), ".");
			$sld = trim(substr($fields->domain, 0, -strlen($tld)), ".");

			$vars = array(
				'NumYears' => 1,
				'tld' => $tld,
				'sld' => $sld
			);
			
			foreach ($package->pricing as $pricing) {
				if ($pricing->id == $service->pricing_id) {
					$vars['NumYears'] = $pricing->term;
					break;
				}
			}

			// Renew the domain
			$command = new EnomAll($api);
			$response = $command->Extend($vars);
			$this->processResponse($api, $response);

			// If the domain renewal failed, it may be expired, so attempt to re-activate and renew it instead
			if ($this->Input->errors()){
				$vars = array(
					'NumYears' => $vars['NumYears'],
					'DomainName' => $fields->domain
				);
				$response = $command->UpdateExpiredDomains($vars);
				$this->processResponse($api, $response);
			}
		}
		else {
			#
			# TODO: SSL Cert: Set cancelation date of service?
			#
		}
		
		return null;
	}

Hope that helps ;)

 

Regards,

PV

Edited by PauloV
Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
  • 6 months later...

Big +1 again.  Had some domains expire due to this :(

 

Strange this has not ben apply, this was/is a MAJOR problem, and should be reseolved ASAP, this ais a very basic funtion vital for any Registrar Module.

 

You can apply my fix above http://www.blesta.com/forums/index.php?/topic/3028-enom-module-missing-renew-extend-command/#entry21773

 

@Paul / @Tyson / @Cody

 

Please add this code above ASAP, its a BIGGGG problem for everyone that uses eNom, and this is vital for a company, this cannot ever/never happend, it can cause serious problems and even shutdown a Hosting Company if we loose a Client Domain.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...