diff --git a/bb-library/Registrar/Adapter/Namesilo.php b/bb-library/Registrar/Adapter/Namesilo.php index 1ae9577..dc9567f 100644 --- a/bb-library/Registrar/Adapter/Namesilo.php +++ b/bb-library/Registrar/Adapter/Namesilo.php @@ -1,8 +1,15 @@ null + 'apikey' => null, + 'Payment_ID' => null ); public function __construct($options) { @@ -15,6 +22,13 @@ public function __construct($options) } else { throw new Registrar_Exception('Domain registrar "Namesilo" is not configured properly. Please update configuration parameter "Namesilo Apikey" at "Configuration -> Domain registration".'); } + + if(isset($options['Payment_ID']) && !empty($options['Payment_ID'])) { + $this->config['Payment_ID'] = $options['Payment_ID']; + unset($options['Payment_ID']); + } else { + throw new Registrar_Exception('Domain registrar "Namesilo" is not configured preoprly. Please update configuration paramer Payment ID".'); + } } public static function getConfig() { @@ -27,9 +41,15 @@ public static function getConfig() 'renderPassword' => true, ), ), - ), - ); + 'Payment_ID' => array('Payment_ID', array( + 'label' => 'Payment ID', + 'description'=>'Payment ID', + ), + ), + ), + ); } + public function getTlds() { return array( @@ -226,7 +246,6 @@ public function deleteDomain(Registrar_Domain $domain) { throw new Registrar_Exception('Registrar does not support domain removal.'); } - /** * @param Registrar_Domain $domain * @return bool @@ -239,7 +258,7 @@ public function registerDomain(Registrar_Domain $domain) $params = array( 'domain' => $domain->getName(), - 'years' => $domain->getRegistrationPeriod(), + 'years' => $domain->getRegistrationPeriod(), 'fn' => $c->getFirstName(), 'ln' => $c->getLastName(), @@ -419,6 +438,7 @@ private function _request($cmd, $params) $params['version'] = 1; $params['type'] = 'xml'; $params['key'] = $this->config['apikey']; + $params['payment_id'] = $this->config['Payment_ID']; $query = http_build_query($params);