projects
/
Net-Vitelity.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9bf9b61
)
add debug flag
author
Ivan Kohler
<ivan@freeside.biz>
Tue, 23 May 2017 18:29:45 +0000
(11:29 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Tue, 23 May 2017 18:29:45 +0000
(11:29 -0700)
Changes
patch
|
blob
|
history
lib/Net/Vitelity.pm
patch
|
blob
|
history
diff --git
a/Changes
b/Changes
index
e727d50
..
8f33fa8
100644
(file)
--- a/
Changes
+++ b/
Changes
@@
-1,5
+1,8
@@
Revision history for Net-Vitelity
Revision history for Net-Vitelity
+0.05 unreleased
+ - Add debug flag
+
0.04 unreleased
- Add support for lnp apitype/URL
0.04 unreleased
- Add support for lnp apitype/URL
diff --git
a/lib/Net/Vitelity.pm
b/lib/Net/Vitelity.pm
index
4409b5b
..
0715b91
100644
(file)
--- 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
'login' => $your_login,
'pass' => $your_pass,
'apitype' => 'api', #api, fax or lnp
+ 'debug' => 0,
);
=head1 METHODS
);
=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';
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;
}
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';
$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},
my $response = $ua->post($url, {
login => $self->{login},
pass => $self->{pass},