Skip to content

Commit 72dfbee

Browse files
committed
Added Autorenew commands for the CO.ZA extension
1 parent b6fec74 commit 72dfbee

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
namespace Metaregistrar\EPP;
3+
/**
4+
*
5+
<epp:epp xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:epp="urn:ietf:params:xml:ns:epp-1.0" xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xmlns:cozadomain="http://co.za/epp/extensions/cozadomain-1-0" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
6+
<epp:command>
7+
<epp:update>
8+
<domain:update xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd">
9+
<domain:name>exampledomain.gtld</domain:name>
10+
</domain:update>
11+
</epp:update>
12+
<epp:extension>
13+
<cozadomain:update xsi:schemaLocation="http://co.za/epp/extensions/cozadomain-1-0 coza-domain-1.0.xsd">
14+
<cozadomain:chg>
15+
<cozadomain:autorenew>true</cozadomain:autorenew>
16+
</cozadomain:chg>
17+
</cozadomain:update>
18+
</epp:extension>
19+
</epp:command>
20+
</epp:epp>
21+
*/
22+
23+
class cozaEppAutorenewRequest extends eppUpdateDomainRequest {
24+
25+
function __construct($object, $onoff) {
26+
parent::__construct($object,null,null,$object);
27+
$this->addCozaExtension($onoff);
28+
$this->addSessionId();
29+
}
30+
31+
public function addCozaExtension($onoff) {
32+
$this->addExtension('xmlns:cozadomain', 'http://co.za/epp/extensions/cozadomain-1-0');
33+
$domain = $this->createElement('cozadomain:update');
34+
$change = $this->createElement('cozadomain:chg');
35+
$update = $this->createElement('cozadomain:autorenew',($onoff?'true':'false'));
36+
$change->appendChild($update);
37+
$domain->appendChild($change);
38+
$this->getExtension()->appendChild($domain);
39+
}
40+
41+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
namespace Metaregistrar\EPP;
3+
4+
/**
5+
<epp:epp xmlns:epp="urn:ietf:params:xml:ns:epp-1.0" xmlns:cozadomain="http://co.za/epp/extensions/cozadomain-1-0">
6+
<epp:response>
7+
<epp:result code="1001">
8+
<epp:msg>Domain update pending</epp:msg>
9+
</epp:result>
10+
<epp:extension>
11+
<cozadomain:cozaData>
12+
<cozadomain:detail result="success">AutoRenew 'True' successful</cozadomain:detail>
13+
</cozadomain:cozaData>
14+
</epp:extension>
15+
<epp:trID>
16+
<epp:svTRID>ZACR-EPP-12E52F2BC78-8AC51</epp:svTRID>
17+
</epp:trID>
18+
</epp:response>
19+
</epp:epp>
20+
*/
21+
22+
/**
23+
* Class cozaEppInfoContactResponse
24+
* @package Metaregistrar\EPP
25+
*/
26+
class cozaEppAutorenewResponse extends eppUpdateDomainResponse
27+
{
28+
29+
function __construct() {
30+
parent::__construct();
31+
}
32+
33+
/**
34+
* Retrieve the response for the autorenew request
35+
* @return string|null
36+
*/
37+
public function getAutorenewResult() {
38+
return $this->queryPath('/epp:epp/epp:response/epp:extension/cozadomain:cozaData/cozadomain:detail');
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
$this->addExtension('cozadomain', 'http://co.za/epp/extensions/cozadomain-1-0');
3+
4+
include_once(dirname(__FILE__) . '/eppRequests/cozaEppAutorenewRequest.php');
5+
include_once(dirname(__FILE__) . '/eppResponses/cozaEppAutorenewResponse.php');
6+
$this->addCommandResponse('Metaregistrar\EPP\cozaEppAutorenewRequest', 'Metaregistrar\EPP\cozaEppAutorenewResponse');

Registries/cozaEppConnection/eppConnection.php

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public function __construct($logging = false, $settingsfile = null) {
88
parent::__construct($logging, $settingsfile);
99
parent::setServices(array('urn:ietf:params:xml:ns:domain-1.0' => 'domain', 'urn:ietf:params:xml:ns:contact-1.0' => 'contact'));
1010
parent::useExtension('cozacontact-1.0');
11+
parent::useExtension('cozadomain-1.0');
1112
parent::useExtension('charge-1.0');
1213
parent::enableDnssec();
1314
}

0 commit comments

Comments
 (0)