1: <?php
2:
3: require_once('ApiSettings.php');
4: require_once('DomainCheckResult.php');
5: require_once('Domain.php');
6: require_once('Nameserver.php');
7: require_once('WhoisContact.php');
8: require_once('DnsEntry.php');
9: require_once('DomainBranding.php');
10: require_once('ExtraContactField.php');
11: require_once('Tld.php');
12: require_once('DomainAction.php');
13:
14: /**
15: * This is the API endpoint for the DomainService
16: *
17: * @package Transip
18: * @class DomainService
19: * @author TransIP (support@transip.nl)
20: */
21: class Transip_DomainService
22: {
23: // These fields are SOAP related
24: /** The SOAP service that corresponds with this class. */
25: const SERVICE = 'DomainService';
26: /** The API version. */
27: const API_VERSION = '5.23';
28: /** @var SoapClient The SoapClient used to perform the SOAP calls. */
29: protected static $_soapClient = null;
30:
31: /**
32: * Gets the singleton SoapClient which is used to connect to the TransIP Api.
33: *
34: * @param mixed $parameters Parameters.
35: * @return SoapClient The SoapClient object to which we can connect to the TransIP API
36: */
37: public static function _getSoapClient($parameters = array())
38: {
39: $endpoint = Transip_ApiSettings::$endpoint;
40:
41: if(self::$_soapClient === null)
42: {
43: $extensions = get_loaded_extensions();
44: $errors = array();
45: if(!class_exists('SoapClient') || !in_array('soap', $extensions))
46: {
47: $errors[] = 'The PHP SOAP extension doesn\'t seem to be installed. You need to install the PHP SOAP extension. (See: http://www.php.net/manual/en/book.soap.php)';
48: }
49: if(!in_array('openssl', $extensions))
50: {
51: $errors[] = 'The PHP OpenSSL extension doesn\'t seem to be installed. You need to install PHP with the OpenSSL extension. (See: http://www.php.net/manual/en/book.openssl.php)';
52: }
53: if(!empty($errors)) die('<p>' . implode("</p>\n<p>", $errors) . '</p>');
54:
55: $classMap = array(
56: 'DomainCheckResult' => 'Transip_DomainCheckResult',
57: 'Domain' => 'Transip_Domain',
58: 'Nameserver' => 'Transip_Nameserver',
59: 'WhoisContact' => 'Transip_WhoisContact',
60: 'DnsEntry' => 'Transip_DnsEntry',
61: 'DomainBranding' => 'Transip_DomainBranding',
62: 'ExtraContactField' => 'Transip_ExtraContactField',
63: 'Tld' => 'Transip_Tld',
64: 'DomainAction' => 'Transip_DomainAction',
65: );
66:
67: $options = array(
68: 'classmap' => $classMap,
69: 'encoding' => 'utf-8', // lets support unicode
70: 'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // see http://bugs.php.net/bug.php?id=43338
71: 'trace' => false, // can be used for debugging
72: );
73:
74: $wsdlUri = "https://{$endpoint}/wsdl/?service=" . self::SERVICE;
75: try
76: {
77: self::$_soapClient = new SoapClient($wsdlUri, $options);
78: }
79: catch(SoapFault $sf)
80: {
81: throw new Exception("Unable to connect to endpoint '{$endpoint}'");
82: }
83: self::$_soapClient->__setCookie('login', Transip_ApiSettings::$login);
84: self::$_soapClient->__setCookie('mode', Transip_ApiSettings::$mode);
85: }
86:
87: $timestamp = time();
88: $nonce = uniqid('', true);
89:
90: self::$_soapClient->__setCookie('timestamp', $timestamp);
91: self::$_soapClient->__setCookie('nonce', $nonce);
92: self::$_soapClient->__setCookie('clientVersion', self::API_VERSION);
93: self::$_soapClient->__setCookie('signature', self::_urlencode(self::_sign(array_merge($parameters, array(
94: '__service' => self::SERVICE,
95: '__hostname' => $endpoint,
96: '__timestamp' => $timestamp,
97: '__nonce' => $nonce
98: )))));
99:
100: return self::$_soapClient;
101: }
102:
103: /**
104: * Calculates the hash to sign our request with based on the given parameters.
105: *
106: * @param mixed $parameters The parameters to sign.
107: * @return string Base64 encoded signing hash.
108: */
109: protected static function _sign($parameters)
110: {
111: // Fixup our private key, copy-pasting the key might lead to whitespace faults
112: if(!preg_match('/-----BEGIN (RSA )?PRIVATE KEY-----(.*)-----END (RSA )?PRIVATE KEY-----/si', Transip_ApiSettings::$privateKey, $matches))
113: die('<p>Could not find your private key, please supply your private key in the ApiSettings file. You can request a new private key in your TransIP Controlpanel.</p>');
114:
115: $key = $matches[2];
116: $key = preg_replace('/\s*/s', '', $key);
117: $key = chunk_split($key, 64, "\n");
118:
119: $key = "-----BEGIN PRIVATE KEY-----\n" . $key . "-----END PRIVATE KEY-----";
120:
121: $digest = self::_sha512Asn1(self::_encodeParameters($parameters));
122: if(!@openssl_private_encrypt($digest, $signature, $key))
123: die('<p>Could not sign your request, please supply your private key in the ApiSettings file. You can request a new private key in your TransIP Controlpanel.</p>');
124:
125: return base64_encode($signature);
126: }
127:
128: /**
129: * Creates a digest of the given data, with an asn1 header.
130: *
131: * @param string $data The data to create a digest of.
132: * @return string The digest of the data, with asn1 header.
133: */
134: protected static function _sha512Asn1($data)
135: {
136: $digest = hash('sha512', $data, true);
137:
138: // this ASN1 header is sha512 specific
139: $asn1 = chr(0x30).chr(0x51);
140: $asn1 .= chr(0x30).chr(0x0d);
141: $asn1 .= chr(0x06).chr(0x09);
142: $asn1 .= chr(0x60).chr(0x86).chr(0x48).chr(0x01).chr(0x65);
143: $asn1 .= chr(0x03).chr(0x04);
144: $asn1 .= chr(0x02).chr(0x03);
145: $asn1 .= chr(0x05).chr(0x00);
146: $asn1 .= chr(0x04).chr(0x40);
147: $asn1 .= $digest;
148:
149: return $asn1;
150: }
151:
152: /**
153: * Encodes the given paramaters into a url encoded string based upon RFC 3986.
154: *
155: * @param mixed $parameters The parameters to encode.
156: * @param string $keyPrefix Key prefix.
157: * @return string The given parameters encoded according to RFC 3986.
158: */
159: protected static function _encodeParameters($parameters, $keyPrefix = null)
160: {
161: if(!is_array($parameters) && !is_object($parameters))
162: return self::_urlencode($parameters);
163:
164: $encodedData = array();
165:
166: foreach($parameters as $key => $value)
167: {
168: $encodedKey = is_null($keyPrefix)
169: ? self::_urlencode($key)
170: : $keyPrefix . '[' . self::_urlencode($key) . ']';
171:
172: if(is_array($value) || is_object($value))
173: {
174: $encodedData[] = self::_encodeParameters($value, $encodedKey);
175: }
176: else
177: {
178: $encodedData[] = $encodedKey . '=' . self::_urlencode($value);
179: }
180: }
181:
182: return implode('&', $encodedData);
183: }
184:
185: /**
186: * Our own function to encode a string according to RFC 3986 since.
187: * PHP < 5.3.0 encodes the ~ character which is not allowed.
188: *
189: * @param string $string The string to encode.
190: * @return string The encoded string according to RFC 3986.
191: */
192: protected static function _urlencode($string)
193: {
194: $string = trim($string);
195: $string = rawurlencode($string);
196: return str_replace('%7E', '~', $string);
197: }
198:
199: const AVAILABILITY_INYOURACCOUNT = 'inyouraccount';
200: const AVAILABILITY_UNAVAILABLE = 'unavailable';
201: const AVAILABILITY_NOTFREE = 'notfree';
202: const AVAILABILITY_FREE = 'free';
203: const AVAILABILITY_INTERNALPULL = 'internalpull';
204: const CANCELLATIONTIME_END = 'end';
205: const CANCELLATIONTIME_IMMEDIATELY = 'immediately';
206: const ACTION_REGISTER = 'register';
207: const ACTION_TRANSFER = 'transfer';
208: const ACTION_INTERNALPULL = 'internalpull';
209: const TRACK_ENDPOINT_NAME = 'Domain';
210:
211: /**
212: * Checks the availability of multiple domains.
213: *
214: * @param string[] $domainNames The domain names to check for availability.<br /><br />- A maximum of 20 domainNames at once can be checked.<br />- domainNames must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
215: * @example examples/DomainService-batchCheckAvailability.php
216: * @throws ApiException
217: * @return Transip_DomainCheckResult[] A list of DomainCheckResult objects, holding the domainName and the status per result.
218: */
219: public static function batchCheckAvailability($domainNames)
220: {
221: return self::_getSoapClient(array_merge(array($domainNames), array('__method' => 'batchCheckAvailability')))->batchCheckAvailability($domainNames);
222: }
223:
224: /**
225: * Checks the availability of a domain.
226: *
227: * @param string $domainName The domain name to check for availability.<br /><br />- domainName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
228: * @return string the availability status of the domain name:<br /><br />- free the domain is free for registration<br />- notfree the domain is not free for new registration, but can possibly be transferred<br />- inyouraccount the domain is already in your account<br />- unavailable the domain is not available for registration
229: * @example examples/DomainService-checkAvailability.php
230: */
231: public static function checkAvailability($domainName)
232: {
233: return self::_getSoapClient(array_merge(array($domainName), array('__method' => 'checkAvailability')))->checkAvailability($domainName);
234: }
235:
236: /**
237: * Gets the whois of a domain name
238: *
239: * @param string $domainName the domain name to get the whois for<br /><br />- domainName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
240: * @return string the whois data for the domain
241: * @throws ApiException
242: * @example examples/DomainService-getWhois.php
243: */
244: public static function getWhois($domainName)
245: {
246: return self::_getSoapClient(array_merge(array($domainName), array('__method' => 'getWhois')))->getWhois($domainName);
247: }
248:
249: /**
250: * Gets the names of all domains in your account.
251: *
252: * @return string[] A list of all domains in your account
253: * @example examples/DomainService-getDomainNames.php
254: */
255: public static function getDomainNames()
256: {
257: return self::_getSoapClient(array_merge(array(), array('__method' => 'getDomainNames')))->getDomainNames();
258: }
259:
260: /**
261: * Get information about a domainName.
262: *
263: * @param string $domainName The domainName to get the information for.<br /><br />- domainName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
264: * @example examples/DomainService-DomainService-getInfo.php
265: * @throws ApiException If the Domain could not be found.
266: * @return Transip_Domain A Domain object holding the data for the requested domainName.
267: */
268: public static function getInfo($domainName)
269: {
270: return self::_getSoapClient(array_merge(array($domainName), array('__method' => 'getInfo')))->getInfo($domainName);
271: }
272:
273: /**
274: * Get information about a list of Domain names.
275: *
276: * @param string[] $domainNames A list of Domain names you want information for.<br /><br />- domainNames must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
277: * @throws Exception If something else went wrong.
278: * @return Transip_Domain[] Domain objects.
279: */
280: public static function batchGetInfo($domainNames)
281: {
282: return self::_getSoapClient(array_merge(array($domainNames), array('__method' => 'batchGetInfo')))->batchGetInfo($domainNames);
283: }
284:
285: /**
286: * Gets the Auth code for a domainName
287: *
288: * @param string $domainName the domainName to get the authcode for<br /><br />- domainName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
289: * @deprecated
290: * @return string the authentication code for a domain name
291: * @example examples/DomainService-DomainService-getAuthCode.php
292: */
293: public static function getAuthCode($domainName)
294: {
295: return self::_getSoapClient(array_merge(array($domainName), array('__method' => 'getAuthCode')))->getAuthCode($domainName);
296: }
297:
298: /**
299: * Gets the lock status for a domainName
300: *
301: * @param string $domainName the domainName to get the lock status for<br /><br />- domainName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
302: * @return boolean true iff the domain is locked at the registry
303: * @deprecated use getInfo()
304: */
305: public static function getIsLocked($domainName)
306: {
307: return self::_getSoapClient(array_merge(array($domainName), array('__method' => 'getIsLocked')))->getIsLocked($domainName);
308: }
309:
310: /**
311: * Will get additional contact data fields for domain.
312: *
313: * <br />
314: *
315: * <b>COUNTRY_CODE</b>: A 2 letter country from the <a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Decoding_table" target="_blanc">ISO 3166-1 alpha-2 standard</a>. <br />
316: * <b>PERSONAL_IDENTIFICATION_NUMBER</b>: Your personal id number when registering as a natural person. Kvk when registering as a company. <br />
317: * <b>REGISTRANT_TYPE</b>: Fill in whether you register the domain name as a person or as a company. <br />
318: * <b>VAT_NUMBER</b>: A valid VAT number is required to register this domain. <br />
319: * <b>FIRST_NAME</b>: Your full first name has to be provided here.<br />
320: * <b>LAST_NAME</b>: Your full last name has to be provided here.<br />
321: * <b>BIRTH_DATE</b>: You have to supply your birth date here. Please do so in the format ‘YYYY-MM-DD’.<br />
322: * <b>COMPANY_REGISTRATION_ID</b>: Please provide the company registration id if the domain is being registered on behalf of or by a company.<br />
323: * <b>INTENDED_USE</b>: You should provide a short explanation on what you are going to use this domain for.<br />
324: * <b>CODICE_FISCALE</b>: A valid Codice Fiscale (16 characters) is required to register this domain.<br />
325: * <b>ADMIN_IDENTIFICATION_NUMBER</b>: Provide the identifier for the adminstrative contact. For example a personal id.<br />
326: * <b>ADMIN_IDENTIFICATION_TYPE</b>: Administrative contact Identification type<br />
327: * <b>OWNER_IDENTIFICATION_NUMBER</b>: Provide the identifier for the holder. For example a personal id or AVT.<br />
328: * <b>OWNER_IDENTIFICATION_TYPE</b>: Holder Identifier type<br />
329: * <b>OWNER_LEGAL_FORM</b>: Select the legal form for the holder.<br />
330: * <b>TECH_IDENTIFICATION_NUMBER</b>: Provide the identifier for the technical contact. For example a personal id.<br />
331: * <b>TECH_IDENTIFICATION_TYPE</b>: Technical contact Identifier type<br />
332: * <b>OWNER_VAT_NUMBER</b>: For the registration of this domain a valid VAT number of the registrant is required<br />
333: * <b>TECH_VAT_NUMBER</b>: For the registration of this domain a valid VAT number of the technical contact is required<br />
334: * <b>COMMUNITY_ID</b>: The community ID from the Sponsored Community is a unique code that consists of 16 characters.<br />
335: * <b>LEGAL_FORM_DUTCH</b>: Choose legalform<br />
336: *
337: * <br />
338: *
339: * Tld specific cases <br />
340: *
341: * <b>.amsterdam</b> <br />
342: * Choose one of the following options for LEGAL_FORM_DUTCH: ANDERS, BGG, BRO, BV, BVI/O, COOP, CV, EENMANSZAAK, EESV, KERK, MAATSCHAP, NV, OWM, PERSOON, REDR, STICHTING, VERENIGING, VOF <br />
343: *
344: * <br />
345: *
346: * <b>.es and .com.es</b> <br />
347: * For ADMIN_IDENTIFICATION_TYPE, OWNER_IDENTIFICATION_TYPE and TECH_IDENTIFICATION_TYPE use following values: <br />
348: * For Non Spanish identification number use: <b>0</b> <br />
349: * For Spanish identification number use: <b>1</b> <br />
350: * For Spanish identification number for residents use: <b>3</b> <br />
351: *
352: * <br />
353: *
354: * <b>.fr</b> <br />
355: * If registering as a person use: FIRST_NAME, LAST_NAME. <br />
356: * If registering as a company use: FIRST_NAME, LAST_NAME, VAT_NUMBER, COUNTRY_CODE <br />
357: *
358: * <br />
359: *
360: * <b>.it</b> <br />
361: * <b>1.</b> Use only COUNTRY_CODE in NOT any of the following codes: AT, BE, CY, CZ, DE, DK, EE, ES, FI, FR, GB, GR, HU, IE, LT, LU, LV, MT, NL, PL, PT, SE, SI, SK, BG or RO <br />
362: * <b>2.</b> If COUNTRY_CODE is IT use: COUNTRY_CODE and CODICE_FISCALE <br />
363: * <b>3.</b> If REGISTRANT_TYPE is company and COUNTRY_CODE is any of the following: AT, BE, CY, CZ, DE, DK, EE, ES, FI, FR, GB, GR, HU, IE, LT, LU, LV, MT, NL, PL, PT, SE, SI, SK, BG or RO use: COUNTRY_CODE, REGISTRANT_TYPE and VAT_NUMBER <br />
364: * <b>4.</b> If REGISTRANT_TYPE is person and COUNTRY_CODE is any of the following: AT, BE, CY, CZ, DE, DK, EE, ES, FI, FR, GB, GR, HU, IE, LT, LU, LV, MT, NL, PL, PT, SE, SI, SK, BG or RO use: COUNTRY_CODE, REGISTRANT_TYPE and PERSONAL_IDENTIFICATION_NUMBER <br />
365: *
366: * <br />
367: *
368: * <b>.nu</b> <br />
369: * <b>1.</b> Use only PERSONAL_IDENTIFICATION_NUMBER when registrant is a person <br />
370: * <b>2.</b> If ordering as a company and VAT_COUNTRY_CODE is NOT: AT, BE, CY, CZ, DE, DK, EE, ES, FI, FR, GB, GR, HU, IE, IT, LT, LU, LV, MT, NL, PL, PT, SE, SI, SK, BG, RO use PERSONAL_IDENTIFICATION_NUMBER and VAT_COUNTRY_CODE <br />
371: * <b>3.</b> If ordering as a company and VAT_COUNTRY_CODE is one of the following: AT, BE, CY, CZ, DE, DK, EE, ES, FI, FR, GB, GR, HU, IE, IT, LT, LU, LV, MT, NL, PL, PT, SE, SI, SK, BG, RO use PERSONAL_IDENTIFICATION_NUMBER, VAT_COUNTRY_CODE and VAT_NUMBER <br />
372: *
373: * <br />
374: *
375: * <b>.pm, .re, .tf, .wf and .yt</b> <br />
376: * <b>1.</b> If registering as a person use: FIRST_NAME and LAST_NAME <br />
377: * <b>2.</b> If registering as a company use: VAT_NUMBER, VAT_COUNTRY_CODE, FIRST_NAME and LAST_NAME <br />
378: *
379: * <br />
380: *
381: * <b>.se</b> <br />
382: * <b>1.</b> If registering as a person use: PERSONAL_IDENTIFICATION_NUMBER <br />
383: * <b>2.</b> If registering as a company use: PERSONAL_IDENTIFICATION_NUMBER, VAT_COUNTRY_CODE and VAT_NUMBER
384: *
385: * @param string $domainName
386: * @example examples/DomainService-DomainService-getExtraContactFields.php
387: * @return string[]
388: */
389: public static function getExtraContactFields($domainName)
390: {
391: return self::_getSoapClient(array_merge(array($domainName), array('__method' => 'getExtraContactFields')))->getExtraContactFields($domainName);
392: }
393:
394: /**
395: * Registers a domain name, will automatically create and sign a proposition for it
396: *
397: * @param Transip_Domain $domain The Domain object holding information about the domain that needs to be registered.
398: * @requires readwrite mode
399: * @example examples/DomainService-DomainService-register-whois.php
400: * @return string proposition number
401: * @throws UserException
402: */
403: public static function register($domain)
404: {
405: return self::_getSoapClient(array_merge(array($domain), array('__method' => 'register')))->register($domain);
406: }
407:
408: /**
409: * Registers a domain name, will automatically create and sign a proposition for it
410: *
411: * @param Transip_Domain $domain The Domain object holding information about the domain that needs to be registered.
412: * @param Transip_ExtraContactField[] $extraContactFields The ExtraContactFields that are required for this domain.
413: * @requires readwrite mode
414: * @example examples/DomainService-DomainService-register-whois.php
415: * @return string proposition number
416: * @throws UserException
417: */
418: public static function registerWithExtraContactFields($domain, $extraContactFields)
419: {
420: return self::_getSoapClient(array_merge(array($domain, $extraContactFields), array('__method' => 'registerWithExtraContactFields')))->registerWithExtraContactFields($domain, $extraContactFields);
421: }
422:
423: /**
424: * Cancels a domain name, will automatically create and sign a cancellation document
425: * Please note that domains with webhosting cannot be cancelled through the API
426: *
427: * @param string $domainName The domainname that needs to be cancelled.<br /><br />- domainName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
428: * @param string $endTime The time to cancel the domain (DomainService::CANCELLATIONTIME_END (end of contract)
429: * @requires readwrite mode
430: * @example examples/DomainService-DomainService-cancel.php
431: * @throws ApiException
432: */
433: public static function cancel($domainName, $endTime)
434: {
435: return self::_getSoapClient(array_merge(array($domainName, $endTime), array('__method' => 'cancel')))->cancel($domainName, $endTime);
436: }
437:
438: /**
439: * Transfers a domain without changing the owner
440: *
441: * @param Transip_Domain $domain the Domain object holding information about the domain that needs to be transfered
442: * @param string $authCode the authorization code for domains needing this for transfers (e.g. .com or .org transfers). Leave empty when n/a.
443: * @return string proposition number
444: * @throws UserException
445: * @requires readwrite mode
446: * @example examples/DomainService-DomainService-transfer.php
447: */
448: public static function transferWithOwnerChange($domain, $authCode)
449: {
450: return self::_getSoapClient(array_merge(array($domain, $authCode), array('__method' => 'transferWithOwnerChange')))->transferWithOwnerChange($domain, $authCode);
451: }
452:
453: /**
454: * Transfers a domain with changing the owner, not all TLDs support this (e.g. nl)
455: *
456: * @param Transip_Domain $domain the Domain object holding information about the domain that needs to be transfered
457: * @param string $authCode the authorization code for domains needing this for transfers (e.g. .com or .org transfers). Leave empty when n/a.
458: * @param string[] $extraContactFields The ExtraContactFields that are required for this domain.
459: * @return string proposition number
460: * @throws UserException
461: * @requires readwrite mode
462: * @example examples/DomainService-DomainService-transfer.php
463: */
464: public static function transferWithOwnerChangeWithExtraContactFields($domain, $authCode, $extraContactFields)
465: {
466: return self::_getSoapClient(array_merge(array($domain, $authCode, $extraContactFields), array('__method' => 'transferWithOwnerChangeWithExtraContactFields')))->transferWithOwnerChangeWithExtraContactFields($domain, $authCode, $extraContactFields);
467: }
468:
469: /**
470: * Transfers a domain without changing the owner
471: *
472: * @param Transip_Domain $domain the Domain object holding information about the domain that needs to be transfered
473: * @param string $authCode the authorization code for domains needing this for transfers (e.g. .com or .org transfers). Leave empty when n/a.
474: * @return string proposition number
475: * @throws UserException
476: * @requires readwrite mode
477: * @example examples/DomainService-DomainService-transfer.php
478: */
479: public static function transferWithoutOwnerChange($domain, $authCode)
480: {
481: return self::_getSoapClient(array_merge(array($domain, $authCode), array('__method' => 'transferWithoutOwnerChange')))->transferWithoutOwnerChange($domain, $authCode);
482: }
483:
484: /**
485: * Transfers a domain without changing the owner
486: *
487: * @param Transip_Domain $domain the Domain object holding information about the domain that needs to be transfered
488: * @param string $authCode the authorization code for domains needing this for transfers (e.g. .com or .org transfers). Leave empty when n/a.
489: * @param string[] $extraContactFields The ExtraContactFields that are required for this domain.
490: * @return string proposition number
491: * @throws UserException
492: * @requires readwrite mode
493: * @example examples/DomainService-DomainService-transfer.php
494: */
495: public static function transferWithoutOwnerChangeWithExtraContactFields($domain, $authCode, $extraContactFields)
496: {
497: return self::_getSoapClient(array_merge(array($domain, $authCode, $extraContactFields), array('__method' => 'transferWithoutOwnerChangeWithExtraContactFields')))->transferWithoutOwnerChangeWithExtraContactFields($domain, $authCode, $extraContactFields);
498: }
499:
500: /**
501: * Starts a nameserver change for this domain, will replace all existing nameservers with the new nameservers
502: *
503: * @param string $domainName the domainName to change the nameservers for <br /><br /> domainName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
504: * @param Transip_Nameserver[] $nameservers the list of new nameservers for this domain
505: * @example examples/DomainService-DomainService-setNameservers.php
506: */
507: public static function setNameservers($domainName, $nameservers)
508: {
509: return self::_getSoapClient(array_merge(array($domainName, $nameservers), array('__method' => 'setNameservers')))->setNameservers($domainName, $nameservers);
510: }
511:
512: /**
513: * Lock this domain in real time
514: *
515: * @param string $domainName the domainName to set the lock for<br /><br />- domainName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
516: * @example examples/DomainService-DomainService-setLock.php
517: */
518: public static function setLock($domainName)
519: {
520: return self::_getSoapClient(array_merge(array($domainName), array('__method' => 'setLock')))->setLock($domainName);
521: }
522:
523: /**
524: * unlocks this domain in real time
525: *
526: * @param string $domainName the domainName to unlock<br /><br />- domainName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
527: * @example examples/DomainService-DomainService-setLock.php
528: */
529: public static function unsetLock($domainName)
530: {
531: return self::_getSoapClient(array_merge(array($domainName), array('__method' => 'unsetLock')))->unsetLock($domainName);
532: }
533:
534: /**
535: * Sets the DnEntries for this Domain, will replace all existing dns entries with the new entries
536: *
537: * @param string $domainName the domainName to change the dns entries for<br /><br />- domainName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
538: * @param Transip_DnsEntry[] $dnsEntries the list of new DnsEntries for this domain
539: * @deprecated Use DnsService.setDnsEntries instead.
540: */
541: public static function setDnsEntries($domainName, $dnsEntries)
542: {
543: return self::_getSoapClient(array_merge(array($domainName, $dnsEntries), array('__method' => 'setDnsEntries')))->setDnsEntries($domainName, $dnsEntries);
544: }
545:
546: /**
547: * Starts an owner change of a Domain, brings additional costs with the following TLDs:
548: * .be
549: *
550: * @param string $domainName the domainName to change the owner for<br /><br />- domainName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
551: * @param Transip_WhoisContact $registrantWhoisContact the new contact data for this
552: * @example examples/DomainService-DomainService-setOwner.php
553: * @throws ApiException
554: */
555: public static function setOwner($domainName, $registrantWhoisContact)
556: {
557: return self::_getSoapClient(array_merge(array($domainName, $registrantWhoisContact), array('__method' => 'setOwner')))->setOwner($domainName, $registrantWhoisContact);
558: }
559:
560: /**
561: * Starts a contact change of a domain, this will replace all existing contacts
562: *
563: * @param string $domainName the domainName to change the contacts for<br /><br />- domainName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
564: * @param Transip_WhoisContact[] $contacts the list of new contacts for this domain
565: * @throws ApiException
566: * @example examples/DomainService-DomainService-setContacts.php
567: */
568: public static function setContacts($domainName, $contacts)
569: {
570: return self::_getSoapClient(array_merge(array($domainName, $contacts), array('__method' => 'setContacts')))->setContacts($domainName, $contacts);
571: }
572:
573: /**
574: * Get TransIP supported TLDs
575: *
576: * @return Transip_Tld[] Array of Tld objects
577: * @example examples/DomainService-DomainService-getAllTldInfos.php
578: */
579: public static function getAllTldInfos()
580: {
581: return self::_getSoapClient(array_merge(array(), array('__method' => 'getAllTldInfos')))->getAllTldInfos();
582: }
583:
584: /**
585: * Get info about a specific TLD
586: *
587: * @param string $tldName The tld to get information about.<br /><br />- tldName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
588: * @example examples/DomainService-DomainService-getAllTldInfos.php
589: * @throws ApiException If the TLD could not be found.
590: * @return Transip_Tld Tld object with info about this Tld
591: */
592: public static function getTldInfo($tldName)
593: {
594: return self::_getSoapClient(array_merge(array($tldName), array('__method' => 'getTldInfo')))->getTldInfo($tldName);
595: }
596:
597: /**
598: * Gets info about the action this domain is currently running
599: *
600: * @param string $domainName Name of the domain<br /><br />- domainName must meet the requirements specified in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>.
601: * @return Transip_DomainAction if this domain is currently running an action, a corresponding DomainAction with info about the action will be returned. If there is no action running, null will be returned.
602: * @example examples/DomainService-DomainService-domainActions.php
603: */
604: public static function getCurrentDomainAction($domainName)
605: {
606: return self::_getSoapClient(array_merge(array($domainName), array('__method' => 'getCurrentDomainAction')))->getCurrentDomainAction($domainName);
607: }
608:
609: /**
610: * Retries a failed domain action with new domain data. The Domain#name field must contain
611: * the name of the Domain, the nameserver, contacts, dnsEntries fields contain the new data for this domain.
612: * Set a field to null to not change the data.
613: *
614: * @param Transip_Domain $domain The domain with data to retry
615: * @example examples/DomainService-DomainService-domainActions.php
616: * @throws ApiException
617: */
618: public static function retryCurrentDomainActionWithNewData($domain)
619: {
620: return self::_getSoapClient(array_merge(array($domain), array('__method' => 'retryCurrentDomainActionWithNewData')))->retryCurrentDomainActionWithNewData($domain);
621: }
622:
623: /**
624: * Retry a transfer action with a new authcode
625: *
626: * @param Transip_Domain $domain The domain to try the transfer with a different authcode for
627: * @param string $newAuthCode New authorization code to try
628: * @example examples/DomainService-DomainService-domainActions.php
629: * @throws ApiException
630: */
631: public static function retryTransferWithDifferentAuthCode($domain, $newAuthCode)
632: {
633: return self::_getSoapClient(array_merge(array($domain, $newAuthCode), array('__method' => 'retryTransferWithDifferentAuthCode')))->retryTransferWithDifferentAuthCode($domain, $newAuthCode);
634: }
635:
636: /**
637: * Cancels a failed domain action
638: *
639: * @param Transip_Domain $domain the domain to cancel the action for
640: * @example examples/DomainService-DomainService-domainActions.php
641: * @throws ApiException
642: */
643: public static function cancelDomainAction($domain)
644: {
645: return self::_getSoapClient(array_merge(array($domain), array('__method' => 'cancelDomainAction')))->cancelDomainAction($domain);
646: }
647:
648: /**
649: * Request the authcode at the registry
650: *
651: * This function will request the authcode for domains at DNS.be and EURid from the registry
652: *
653: * @param string $domainName the domainNAme to request the autocode for<br /><br />- domainName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
654: * @return string|null the authentication code for the domain name (or null)
655: * @throws ApiException
656: */
657: public static function requestAuthCode($domainName)
658: {
659: return self::_getSoapClient(array_merge(array($domainName), array('__method' => 'requestAuthCode')))->requestAuthCode($domainName);
660: }
661:
662: /**
663: * Handover a Domain to another TransIP User. Please be aware that this will NOT change the owner contact information
664: * at the registry. If you want to change the domain owner at the registry, then you should execute a 'setOwner'.
665: *
666: * @param string $domainName The domain name you want to hand over.
667: * @param string $targetAccountname The target account name.
668: * @throws ApiException on error
669: */
670: public static function handover($domainName, $targetAccountname)
671: {
672: return self::_getSoapClient(array_merge(array($domainName, $targetAccountname), array('__method' => 'handover')))->handover($domainName, $targetAccountname);
673: }
674:
675: /**
676: * Handover a TransIP Domain to your account by using an auth code. Please be aware that this will NOT change the owner contact information
677: * at the registry. If you want to change the domain owner at the registry, then you should execute a 'setOwner'.
678: *
679: * @param string $domainName The domain name you want to handover with an auth code.
680: * @param string $authCode The auth code to authorize the handover.
681: * @throws ApiException
682: */
683: public static function handoverWithAuthCode($domainName, $authCode)
684: {
685: return self::_getSoapClient(array_merge(array($domainName, $authCode), array('__method' => 'handoverWithAuthCode')))->handoverWithAuthCode($domainName, $authCode);
686: }
687:
688: /**
689: * Get Default DNS Entries for a customer.
690: *
691: * @return Transip_DnsEntry[] A list of the default Dns Entries for the currently authenticated user
692: * @throws ApiException If there are not default values
693: */
694: public static function getDefaultDnsEntries()
695: {
696: return self::_getSoapClient(array_merge(array(), array('__method' => 'getDefaultDnsEntries')))->getDefaultDnsEntries();
697: }
698:
699: /**
700: * Get Default DNS Entries for a specific domain
701: *
702: * @param string $domainName The domainName to get the information for.<br /><br />- domainName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
703: * @return Transip_DnsEntry[] A list of the default DNS entries for this domain
704: * @throws ApiException If the domain could not be found.
705: */
706: public static function getDefaultDnsEntriesByDomainName($domainName)
707: {
708: return self::_getSoapClient(array_merge(array($domainName), array('__method' => 'getDefaultDnsEntriesByDomainName')))->getDefaultDnsEntriesByDomainName($domainName);
709: }
710:
711: /**
712: * Get Default Nameservers for a customer
713: *
714: * @return Transip_Nameserver[] A list of Nameservers for the currently authenticated API User
715: * @throws ApiException
716: */
717: public static function getDefaultNameservers()
718: {
719: return self::_getSoapClient(array_merge(array(), array('__method' => 'getDefaultNameservers')))->getDefaultNameservers();
720: }
721:
722: /**
723: * Get the Default nameservers for the given domain.
724: *
725: * @param string $domainName The domainName to get the information for.<br /><br />- domainName must meet the requirements for a domain name described in: <a href="https://tools.ietf.org/html/rfc952" target="_blanc">RFC 952</a>
726: * @return Transip_Nameserver[] A list of the default Nameservers for this domain
727: * @throws ApiException If the domain could not be found
728: */
729: public static function getDefaultNameserversByDomainName($domainName)
730: {
731: return self::_getSoapClient(array_merge(array($domainName), array('__method' => 'getDefaultNameserversByDomainName')))->getDefaultNameserversByDomainName($domainName);
732: }
733: }
734:
735: ?>
736: