metaregistrar / php-epp-client

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

Update domain Status #311

Closed bibawa closed 3 years ago

bibawa commented 3 years ago

Hi,

I'm trying to update the domain status of a domainname with the following code:

$domain = new eppDomain("domain.be"); $update = new eppDomain("domain.be"); $update->addStatus('clientTransferProhibited'); $request = new eppUpdateDomainRequest($domain, null, null, $update); $result = $conn->request($request);

Every time when I run this command I receive error message "Error 2001: Command syntax error"

Does anyone has any idea about what I'm doing the wrong way ?

brg,

stuarthaas-spark commented 3 years ago

@bibawa Statuses can be updated through add and delete but not update.

$add = new eppDomain("domain.be");
$add->addStatus('clientTransferProhibited');
$request = new eppUpdateDomainRequest($domain, $add);

To remove the status you'll need to provide it to the delete handler.

$delete = new eppDomain("domain.be");
$delete->addStatus('clientTransferProhibited');
$request = new eppUpdateDomainRequest($domain, null, $delete);
bibawa commented 3 years ago

Thanks! that's working perfectly.