thedarkwinter / Net-DRI

Perl EPP Client: Net-DRI-0.X_tdw based on Net-DRI-0.96_09
GNU General Public License v2.0
19 stars 15 forks source link

Support Domain:Trade #404

Open ivan1986 opened 4 years ago

ivan1986 commented 4 years ago

https://wiki.rrpproxy.net/api/epp-command/Domain:Trade

on .at domains

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
  <command>
    <update>
      <domain:update xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd">
        <domain:name>qvq.at</domain:name>
        <domain:add>
          <domain:contact type="admin">P-TIY593</domain:contact>
          <domain:contact type="billing">P-TIY593</domain:contact>
          <domain:contact type="tech">P-TIY593</domain:contact>
        </domain:add>
        <domain:rem>
          <domain:contact type="admin">P-TDS10376</domain:contact>
          <domain:contact type="billing">P-TDS10376</domain:contact>
          <domain:contact type="tech">P-TDS10376</domain:contact>
        </domain:rem>
        <domain:chg>
          <domain:registrant>P-TIY593</domain:registrant>
        </domain:chg>
      </domain:update>
    </update>
    <clTRID>CENTRALNIC-3571-1600187256576563</clTRID>
  </command>
</epp>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
  <response>
    <result code="2004">
      <msg>Parameter value range error</msg>
      <value>
        <text>Invalid attribute value; please use TradeDomain command. Can not change owner fromto [Tech Yan] [Tech Sun]</text>
      </value>
    </result>
    <trID>
      <clTRID>CENTRALNIC-3571-1600187256576563</clTRID>
      <svTRID>28415f61-b00e-4bbe-869f-0ea06933d628</svTRID>
    </trID>
  </response>
</epp>
ivan1986 commented 4 years ago
## Domain Registry Interface, CentralNic EPP Fee extension
##
## Copyright (c) 2020 Ivan Borzenkov <ivan.borenkov@gmail.com>. All rights reserved.
##
## This file is part of Net::DRI
##
## Net::DRI is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## See the LICENSE file that comes with this distribution for more details.
####################################################################################################

package Net::DRI::Protocol::EPP::Extensions::CentralNic::TradeDomain;

use strict;
use warnings;

use Net::DRI::Util;
use Net::DRI::Exception;
use Net::DRI::Protocol::EPP::Util;
use DateTime::Duration;
use DateTime::Format::ISO8601;

=pod

=head1 NAME

Net::DRI::Protocol::EPP::Extensions::CentralNic::TradeDomain - CentralNic EPP TradeDomain extension commands for Net::DRI (draft-brown-epp-fees-01, 02, 03, 04, 05, and 06)

=head1 DESCRIPTION

=cut

####################################################################################################

sub register_commands
{
    my %tmp=(
        update => [ \&update, undef ],
    );
    return { 'domain' => \%tmp };
}

sub setup
{
    return;
}

sub update
{
    my ($epp, $domain, $rd) = @_;

    if (!Net::DRI::Util::check_isa($rd,'Net::DRI::Data::Changes') || !$rd->{'registrant'}) {
        return
    }

    my $mes = $epp->message();
    my $eid=$mes->command_extension_register('keysys:update','xmlns:keysys="http://www.key-systems.net/epp/keysys-1.0"', 'keysys');
    my @kv = ();
    push @kv, ['keysys:domain', ['keysys:accept-trade', 1]];
    $mes->command_extension($eid,\@kv);
    return;
}

####################################################################################################
1;
ivan1986 commented 4 years ago

i write prototype and it works in our system, i don't know where also test it.

thedarkwinter commented 4 years ago

Thanks @ivan1986. I have no experience with RRPProxy. I see you have cloned a CentralNIC extension to write this. Is RRPProxy related to CentralNIC, or was this just for convenience? I can then think where this may be better suited and add it with a internal test...

ivan1986 commented 4 years ago

I just get centralnic extension for copy rrpproxy proxy use centralnic provider

thedarkwinter commented 3 years ago

@ivan1986 I started this https://github.com/thedarkwinter/Net-DRI/pull/436/files as just a test based on your suggestion. The KeySys extension currently only implements the Domain:Trade operation as you proposed, so its still missing quite a lot. I will ask @paullojorgge if he has time to have a look at it, but please feel free to add any feedback.

Personally I am unlikely to be able to spend time on this, and would rather not merge a partially implemented extension, so if you or Paulo are able to add to it, that would be appreciated.