php-epp-client icon indicating copy to clipboard operation
php-epp-client copied to clipboard

Domain contacts update problems

Open AkaeyesWanabe opened this issue 1 year ago • 0 comments
trafficstars

I try epp client API for interact with cocca server. Domain is created successfully with all contacts and name servers. When we try to update contact: 1- registrant contacts is never update $response = null; try { // First, retrieve the current domain info. Nameservers can be unset and then set again. $domain = new eppDomain($domainName); $info = new eppInfoDomainRequest($domain); if ($response = $conn->request($info)) { $mod = new eppDomain($domainName); $d = $response->getDomain(); // foreach ($d->getContacts() as $contact) { switch ($contact->getContactType()) { case eppContactHandle::CONTACT_TYPE_REGISTRANT: if ($registrant) { $update = new eppContact(new eppContactPostalInfo($registrant["fullName"], $registrant["city"], $registrant["countryCode"], $registrant["organisation"], $registrant["address"], null, $registrant["postcode"], eppContact::TYPE_LOC), $registrant["email"], $registrant["phone"]); $up = new eppUpdateContactRequest($contact, null, null, $update); if (!$conn->request($up)) { return ["success" => false, "data" => "Registrant contacts error"]; } } break; default: } } // $update = new eppUpdateDomainRequest($domain, null, null, $mod); if ($response = $conn->request($update)) { return ["success" => true]; } } } catch (eppException $e) { if ($response instanceof eppUpdateDomainResponse) { return ["success" => false, "data" => $response->textContent]; } }

2- for all another contacts, the name is replace by the email. for example admin contacts

case eppContactHandle::CONTACT_TYPE_ADMIN: if ($adminContact) { $update = new eppContact(new eppContactPostalInfo($adminContact["fullName"], $adminContact["city"], $adminContact["countryCode"], $adminContact["organisation"], $adminContact["address"], null, $adminContact["postcode"], eppContact::TYPE_LOC), $adminContact["email"], $adminContact["phone"]); $up = new eppUpdateContactRequest($contact, null, null, $update); if (!$conn->request($up)) { return ["success" => false, "data" => "Admin contacts error"]; } } break;

Please could you help us ? we need help quickly for an existing project. I thank you for you works.

AkaeyesWanabe avatar May 14 '24 15:05 AkaeyesWanabe