metaregistrar / php-epp-client

Object-oriented PHP EPP Client
https://www.metaregistrar.com/docs/
MIT License
209 stars 153 forks source link

Domain contacts update problems #385

Closed AkaeyesWanabe closed 1 month ago

AkaeyesWanabe commented 1 month ago

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.

metaregistrar commented 1 month ago

It depends on what the registry gives back as error message. Most of the registries do not permit you to update contact name or contact company name, when a contact handle is associated with a domain name.

That might be the problem in this case, but without the registry error message we will never know.

AkaeyesWanabe commented 1 month ago

Okay thank you for you answer. However when we execute these commands the epp server give no response as error. We can trust the request is ok but when we check nothing has been changed