/**
  * Get the domains for the account
  * @return mixed
  */
 public function Purchase($domain, Purchase $purchaseModel)
 {
     $this->setCommand('Purchase');
     $domainParts = $this->parseDomainName($domain);
     $purchaseModel->setSLD($domainParts['SLD']);
     $purchaseModel->setTLD($domainParts['TLD']);
     foreach ($purchaseModel->getParams() as $key => $property) {
         $this->setParam($key, $property);
     }
     return $this->send();
 }
Exemple #2
0
<?php

use CodifyLLC\EnomApi;
include '../src/Enom.class.php';
// Include the logins file
include 'logins.php';
$enom = new CodifyLLC\EnomApi\EnomHelpers(ENOM_USERNAME, ENOM_PASSWORD);
if (ENOM_MODE == 'live') {
    $enom->setLive();
} else {
    $enom->debugOn();
}
$purchaseModel = new EnomApi\Purchase();
$purchaseModel->setRegistrantFirstName('Lucas');
$purchaseModel->setRegistrantLastName('Hoezee');
$purchaseModel->setRegistrantAddress1('915 Deer Valley Rd');
$purchaseModel->setRegistrantCity('Holly');
$purchaseModel->setRegistrantPostalCode(48442);
$purchaseModel->setRegistrantCountry('US');
$purchaseModel->setRegistrantStateProvince('MI');
$purchaseModel->setRegistrantStateProvinceChoice('S');
$purchaseModel->setRegistrantPhone('+1.6165551212');
$purchaseModel->setRegistrantEmailAddress('*****@*****.**');
$purchaseModel->copyRegistrationInfoTo('AUXBILLING');
$purchaseModel->copyRegistrationInfoTo('TECH');
$purchaseModel->copyRegistrationInfoTo('ADMIN');
$response = $enom->Purchase('4ctestupdated.com', $purchaseModel);
print 'response string = ' . $response . "\n";
print_r($response);
print 'error count = ' . $response->ErrCount . "\n";
if (empty($response->ErrCount)) {