X-Git-Url: http://git.freeside.biz/gitweb/?p=Net-Vitelity.git;a=blobdiff_plain;f=lib%2FNet%2FVitelity.pm;fp=lib%2FNet%2FVitelity.pm;h=0715b91bb5a8f530a5b3da041d522c43501498f3;hp=4409b5bd9604bdf4110049ec90b6609fad664c0b;hb=ed73d4b421ff53c1aad1c1a9c66a8e352240ee1a;hpb=9bf9b615d31c14dbfcf4654a4a4c92914a7fd50b diff --git a/lib/Net/Vitelity.pm b/lib/Net/Vitelity.pm index 4409b5b..0715b91 100644 --- a/lib/Net/Vitelity.pm +++ b/lib/Net/Vitelity.pm @@ -22,6 +22,7 @@ our $AUTOLOAD; 'login' => $your_login, 'pass' => $your_pass, 'apitype' => 'api', #api, fax or lnp + 'debug' => 0, ); =head1 METHODS @@ -39,6 +40,7 @@ sub new { die "missing user and/or password" unless defined $data{'login'} && defined $data{'pass'}; my $self = { 'login' => $data{'login'}, 'pass' => $data{'pass'} }; $self->{apitype} = $data{'apitype'} ? $data{'apitype'} : 'api'; + $self->{debug} = $data{'debug'} ? 1 : 0; bless $self, $class; return $self; } @@ -62,6 +64,12 @@ sub AUTOLOAD { $url = $URL_FAX if $self->{apitype} eq 'fax'; $url = $URL_LNP if $self->{apitype} eq 'lnp'; + if ( $self->{debug} ) { + warn "Vitelity $cmd ($url)\n"; + my %hash = @_; + warn " $_: $hash{$_}\n" foreach keys %hash; + } + my $response = $ua->post($url, { login => $self->{login}, pass => $self->{pass},