Esempio n. 1
0
 /**
  * Add a domain in the cart
  * 
  * @param string $domain
  * @param integer $tld_id
  * @param string $action [registerDomain, transferDomain]
  * @return CartItem or Null
  */
 public function addDomain($domain, $tld_id, $action = "registerDomain", $authcode = null)
 {
     if (!empty($domain)) {
         // Get the price information for the domain product
         $priceInfo = DomainsTlds::getPrice($tld_id, $action);
         // Add the domain in the cart
         $domainitem = new CartItem();
         $domainitem->setName($domain)->setId($tld_id)->setType('domain')->setTaxId($priceInfo['tax_id'])->setCost($priceInfo['cost'])->setUnitprice($priceInfo['price'])->setSetupfee($priceInfo['setupfee'])->addOption('domain', array('name' => $domain, 'tld' => $tld_id, 'action' => $action, 'authcode' => $authcode));
         $this->addItem($domainitem);
         return $domainitem;
     }
     return NULL;
 }