IO-EPP

 view release on metacpan or  search on metacpan

lib/IO/EPP/CoreNic.pm  view on Meta::CPAN

package IO::EPP::CoreNic;

=encoding utf8

=head1 NAME

IO::EPP::CoreNic

=head1 SYNOPSIS

    use IO::EPP::CoreNic;

    # Parameters for IO::Socket::SSL
    my %sock_params = (
        PeerHost        => 'epp.nic.xn--80aswg',
        PeerPort        => 700,
        # without certificate
        Timeout         => 30,
    );

    # Create object, get greeting and call login()
    my $conn = IO::EPP::CoreNic->new( {
        user => 'login',
        pass => 'xxxx',
        sock_params => \%sock_params,
        test_mode => 0, # real connect
    } );

    # Check domain
    my ( $answ, $code, $msg ) = $conn->check_domains( { domains => [ 'xn--d1acufc.xn--80aswg' ] } );

    # Call logout() and destroy object
    undef $conn;

=head1 DESCRIPTION

Module for work with CoreNic domains

Feature: in all responses incomplete xml schemas, for example, instead of C<< <domain:update> >> is written C<< <update> >>

=cut

use IO::EPP::Base;
use parent qw( IO::EPP::Base );

use strict;
use warnings;


sub make_request {
    my ( $action, $params ) = @_;

    $params = IO::EPP::Base::recursive_utf8_unflaged( $params );

    if ( !$params->{tld}  &&  $params->{dname} ) {
        ( $params->{tld} ) = $params->{dname} =~ /^[0-9a-z\-]+\.(.+)$/;
    }

    my ( $self, $code, $msg, $answ );

    unless ( $params->{conn} ) {
        $params->{sock_params}{PeerHost} ||= 'epp.nic.xn--80aswg';
        $params->{sock_params}{PeerPort} ||= 700;

        ( $self, $code, $msg ) = __PACKAGE__->new( $params );

        unless ( $code  and  $code == 1000 ) {
            goto END_MR;
        }
    }
    else {
        $self = $params->{conn};
    }



( run in 1.159 second using v1.01-cache-2.11-cpan-d8267643d1d )