| Net-DRI documentation | Contained in the Net-DRI distribution. |
Net::DRI::Protocol::EPP::Extensions::IT::Contact - .IT EPP Contact extension for Net::DRI
For now, support questions should be sent to:
<noc@towertech.it>
Please also see the SUPPORT file in the distribution.
Alessandro Zummo, <a.zummo@towertech.it>
Copyright (C) 2009-2010 Tower Technologies. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 as published by the Free Software Foundation.
See the LICENSE file that comes with this distribution for more details.
| Net-DRI documentation | Contained in the Net-DRI distribution. |
## Domain Registry Interface, .IT Contact EPP extension ## ## Copyright (C) 2009-2010 Tower Technologies. All rights reserved. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License v2. # # # package Net::DRI::Protocol::EPP::Extensions::IT::Contact; use strict; use warnings; our $VERSION=do { my @r=(q$Revision: 1.1 $=~/\d+/g); sprintf("%d".".%02d" x $#r, @r); };
sub register_commands { my ($class, $version) = @_; my $ops = { 'create' => [ \&create, undef ], }; return { 'contact' => $ops }; } sub build_command_extension { my ($msg, $epp, $tag) = @_; return $msg->command_extension_register($tag, sprintf('xmlns:extcon="%s" xsi:schemaLocation="%s %s"', $msg->nsattrs('it_contact'))); } sub fix_contact { my ($epp, $c, $op) = @_; my $msg = $epp->message; my $eid = build_command_extension($msg, $epp, 'extcon:' . $op); my @ext; push @ext, [ 'extcon:consentForPublishing', $c->consent_for_publishing ] if defined $c->consent_for_publishing; # registrant data (do not alter the order, there's people # who likes to use <sequence> in xsds) my @registrant; push @registrant, [ 'extcon:nationalityCode', $c->nationality_code ] if defined $c->nationality_code; push @registrant, [ 'extcon:entityType', $c->entity_type ] if defined $c->entity_type; push @registrant, [ 'extcon:regCode', $c->reg_code ] if defined $c->reg_code; push @ext, [ 'extcon:registrant', @registrant ] if scalar @registrant; $msg->command_extension($eid, [ @ext ]) if scalar @ext; } sub create { my ($epp, $contact) = @_; return fix_contact($epp, $contact, 'create'); } 1;