Skip to content

Commit f442163

Browse files
authored
Merge pull request #2 from netinternet/feature/domain-contact-modify
Domain contact modification added.
2 parents 24b7ce7 + c4706c1 commit f442163

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

src/Api/Domain.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,15 @@ public function suggestName($keyword, $tldOnly = false, $exactMatch = false)
348348
return $this->request('domains/v5/suggest-names.json', $query, 'GET');
349349
}
350350

351+
/**
352+
* @param $query
353+
* @return array
354+
*/
355+
public function modifyContact($query)
356+
{
357+
return $this->requestWithOrderId('domains/modify-contact.json', $query, 'POST');
358+
}
359+
351360
private function domain($option)
352361
{
353362
return $this->request($this->url, [

tests/DomainTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,26 @@ public function package_should_get_suggest_name()
189189
$this->assertEquals($response['message'], 'success');
190190
}
191191

192+
/** @test */
193+
public function package_should_modify_domain_contacts()
194+
{
195+
$customer = $this->createCustomer();
196+
$contact = $this->createContact(['customer-id' => $customer['customer-id']]);
197+
$domain = str_random(8);
198+
logicboxes()->domain("{$domain}.com")
199+
->register($this->prepareDomainData($customer['customer-id'], $contact['contact-id']));
200+
201+
$contact2 = $this->createContact(['customer-id' => $customer['customer-id']]);
202+
$response = logicboxes()->domain("{$domain}.com")->modifyContact([
203+
'reg-contact-id' => $contact2['contact-id'],
204+
'admin-contact-id' => $contact2['contact-id'],
205+
'tech-contact-id' => $contact2['contact-id'],
206+
'billing-contact-id' => $contact2['contact-id']
207+
]);
208+
$this->assertTrue($response['status']);
209+
$this->assertEquals($response['message'], 'success');
210+
}
211+
192212
private function createDomain()
193213
{
194214
$this->customer = $this->createCustomer();

0 commit comments

Comments
 (0)