Branch Coverage

blib/lib/Business/OnlinePayment/Litle.pm
Criterion Covered Total %
branch 84 334 25.1


line true false branch
34 5 6 if ($val)
36 5 0 unless $tf
44 5 0 if ($val)
46 0 5 unless $tf
54 5 6 if ($val)
56 5 0 unless $tf
64 5 0 if ($val)
66 0 5 unless $tf
108 0 8 if ($opts{'debug'})
116 0 8 unless $key =~ /^default_(\w*)$/
122 2 6 if (defined $_defaults{'Scrubber'})
124 1 1 if (ref $code ne 'CODE') { }
132 8 0 unless $self->api_version
133 8 0 unless $self->batch_api_version
134 8 0 unless $self->chargeback_api_version
135 8 0 unless $self->xmlns
142 0 15 unless (defined $testMode)
144 6 9 if (lc $testMode eq 'sandbox') { }
0 9 elsif (lc $testMode eq 'localhost') { }
0 9 elsif (lc $testMode eq 'prelive') { }
1 8 elsif ($testMode) { }
239 4 2 if $content->{'card_number'}
241 0 6 if ($content->{'recurring_billing'} and $content->{'recurring_billing'} eq 'YES') { }
250 0 6 $content->{'orderSource'} eq 'recurring' ? :
257 6 0 if ($content->{'products'} and ref $content->{'products'} eq 'ARRAY')
264 0 6 if ($content->{'velocity_check'} and ($content->{'velocity_check'} != 0 and not $content->{'velocity_check'} =~ /false/i)) { }
272 0 6 if ($content->{'partial_auth'} and ($content->{'partial_auth'} != 0 and not $content->{'partial_auth'} =~ /false/i)) { }
288 232 56 if (defined $$content{$trunc->[0]}) { }
0 56 elsif ($trunc->[4]) { }
291 0 232 if ($trunc->[3] and $trunc->[2] and $len != 0 and $len < $trunc->[2]) { }
0 232 elsif ($trunc->[3] and $trunc->[1] and $len > $trunc->[1]) { }
309 54 24 if (defined $data->{$field})
318 6 0 if (defined $data->{$field})
329 12 0 unless $$convertPhone{lc $1}
354 0 6 unless (defined $content->{'description'})
358 0 6 if not defined $content->{'card_token'} and defined $content->{'card_token'}
478 6 0 if (defined $content->{'products'} and scalar @{$content->{'products'};} < 100)
673 0 6 if ($action eq 'registerTokenRequest') { }
5 1 elsif ($action eq 'sale') { }
1 0 elsif ($action eq 'authorization') { }
0 0 elsif ($action eq 'capture') { }
0 0 elsif ($action eq 'force_capture') { }
0 0 elsif ($action eq 'credit') { }
0 0 elsif ($action eq 'void') { }
0 0 elsif ($action eq 'authReversal') { }
0 0 elsif ($action eq 'accountUpdate') { }
674 0 0 if length($content->{'card_number'} || '') == 0
682 1 4 if length($content->{'card_number'} || $content->{'card_token'} || '') == 0
693 3 1 $content->{'card_number'} ? :
1 3 $content->{'card_token'} ? :
720 0 1 if length($content->{'card_number'} || $content->{'card_token'} || '') == 0
731 1 0 $content->{'card_number'} ? :
0 1 $content->{'card_token'} ? :
785 0 0 $content->{'card_number'} ? :
0 0 $content->{'card_token'} ? :
799 0 0 if ($content->{'order_number'}) { }
814 0 0 if length($content->{'card_number'} || $content->{'card_token'} || '') == 0
823 0 0 $content->{'card_number'} ? :
0 0 $content->{'card_token'} ? :
876 0 0 if $Business::OnlinePayment::Litle::DEBUG
878 0 0 if $Business::OnlinePayment::Litle::DEBUG
896 0 0 if $Business::OnlinePayment::Litle::DEBUG
910 0 0 if ($content{'TransactionType'} eq 'capture')
911 0 0 $content{'partial'} ? :
931 0 0 if $Business::OnlinePayment::Litle::DEBUG
933 0 0 if ($] ge '5.008')
935 0 0 if utf8::is_utf8($post_data)
941 0 0 if $Business::OnlinePayment::Litle::DEBUG
947 0 0 if (exists $response->{'response'} and $response->{'response'} == 1) { }
959 0 0 if $Business::OnlinePayment::Litle::DEBUG
967 0 0 if $resp->{'authCode'}
972 0 0 if ($resp->{'enhancedAuthResponse'} and $resp->{'enhancedAuthResponse'}{'fundingSource'} and $resp->{'enhancedAuthResponse'}{'fundingSource'}{'type'} eq 'PREPAID') { }
983 0 0 if (defined $resp->{'duplicate'} and $resp->{'duplicate'} eq 'true') { }
990 0 0 if (defined $resp->{'tokenResponse'})
996 0 0 if ($resp->{'enhancedAuthResponse'} and $resp->{'enhancedAuthResponse'}{'affluence'})
1001 0 0 $self->result_code eq '000' ? :
1002 0 0 if ($self->result_code eq '010' or $self->result_code eq '802' and $self->card_token)
1010 0 0 unless ($self->is_success)
1013 0 0 $Business::OnlinePayment::Litle::ERRORS{$self->result_code}{'failure'} ? :
1018 0 0 unless ($self->is_success)
1019 0 0 unless ($self->error_message)
1034 0 0 if ($self->is_success) { }
1064 0 0 if ($action =~ /(?:UPLOAD|REPLACE)/)
1066 0 0 unless $content{$key}
1075 0 0 unless defined $actionRESTful->{$action}
1079 0 0 if (defined $content{'filecontent'})
1080 0 0 if (length $content{'filecontent'} > 2097152)
1093 0 0 unless (defined $$allowedTypes{$content{'mimetype'} or ''})
1118 0 0 if ($action eq 'RETRIEVE' and $response->{'status'} =~ /^200/ and not substr($response->{'content'}, 0, 500) =~ /
1124 0 0 if (defined $xml_response and defined $xml_response->{'ChargebackCase'}{'Document'}{'ResponseCode'}) { }
1125 0 0 $xml_response->{'ChargebackCase'}{'Document'}{'ResponseCode'} eq '000' ? :
1143 0 0 unless $content{'case_id'}
1144 0 0 unless $content{'merchantid'}
1161 0 0 if (defined $xml_response and $xml_response->{'ChargebackCase'}{'ResponseCode'}) { }
0 0 elsif (defined $xml_response and $xml_response->{'ChargebackCase'}{'DocumentEntry'}) { }
1169 0 0 if (defined $ref->{'id'} and ref $ref->{'id'} eq '')
1183 5 0 if ($status_code =~ /^200/) { }
1184 0 5 unless (eval { do { $response = XMLin($page) } })
1190 0 0 if ($status_code =~ /^(?:900|599)/)
1226 0 0 if (not defined $self->{'batch_entries'} or scalar @{$self->{'batch_entries'};} < 1)
1287 0 0 if $Business::OnlinePayment::Litle::DEBUG
1290 0 0 if ($opts{'method'} and $opts{'method'} eq 'sftp') { }
0 0 elsif ($opts{'method'} and $opts{'method'} eq 'https') { }
1298 0 0 unless $sftp->put($io, "$filename.prg")
1300 0 0 unless $sftp->rename("$filename.prg", "$filename.asc")
1313 0 0 if $Business::OnlinePayment::Litle::DEBUG
1316 0 0 if ($status_code =~ /^200/) { }
1317 0 0 if (not eval { do { $response = XMLin($page) } }) { }
0 0 elsif (exists $response->{'response'} and $response->{'response'} == 1) { }
1342 0 0 $response->{'response'} eq '0' ? :
1344 0 0 if $Business::OnlinePayment::Litle::DEBUG
1345 0 0 unless ($self->is_success)
1346 0 0 unless ($self->error_message)
1357 0 0 if ($self->is_success)
1418 0 0 if $Business::OnlinePayment::Litle::DEBUG
1420 0 0 if $Business::OnlinePayment::Litle::DEBUG
1423 0 0 if ($status_code =~ /^200/) { }
1424 0 0 if (not eval { do { $response = XMLin($page) } }) { }
0 0 elsif (exists $response->{'response'} and $response->{'response'} == 1) { }
1442 0 0 if ($response->{'RFRResponse'}) { }
1451 0 0 $resp->{'response'} eq '000' ? :
1459 0 0 unless $args->{'ftp_username'}
1460 0 0 unless $args->{'ftp_password'}
1469 0 0 if $sftp->error
1471 0 0 if ($dir)
1472 0 0 unless $sftp->setcwd($dir)
1496 0 0 unless my $ls = $sftp->ls('wanted', qr/\.asc$/)
1511 0 0 unless $opts{'batch_id'}
1516 0 0 unless $sftp->remove($filename)
1529 0 0 unless $opts{'batch_id'}
1532 0 0 if ($opts{'batch_return'}) { }
1543 0 0 unless $post_data = $sftp->get_content($filename)
1550 0 0 if (not eval { do { $response = XMLin($post_data, 'ForceArray', ['accountUpdateResponse'], 'KeyAttr', '-id') } }) { }
0 0 elsif (exists $response->{'response'} and $response->{'response'} == 1) { }
1570 0 0 $response->{'response'} eq '0' ? :
1571 0 0 if ($self->is_success)
1594 160 0 if ($map{'content'} and ref $map{'content'} eq 'HASH') { }
1604 106 815 if (ref $map{$_} eq 'HASH') { }
6 809 elsif (ref $map{$_} eq 'ARRAY') { }
0 809 elsif (ref $map{$_}) { }
348 461 elsif (exists $content{$map{$_}}) { }
1605 45 61 if keys %{$map{$_};}
1617 399 522 if (defined $value) { }
1628 60 284 if (ref $value eq 'HASH') { }
5 279 elsif (ref $value eq 'ARRAY') { }
1629 0 60 $value->{'attr'} ? :
1632 0 264 if $_ eq 'attr'
1657 2 5 unless $cc
1674 6 6 unless $ptr
1678 6 0 $ptr->{'cvv2'} ? :
1696 0 0 if (not $content{'activity_date'} && $content{'activity_date'} =~ /^\d{4}-(\d{2})-(\d{2})$/ or $1 > 12 or $2 > 31)
1707 0 0 if (defined $content{'financial_only'}) { }
1708 0 0 $content{'financial_only'} ? :
1750 0 0 if $Business::OnlinePayment::Litle::DEBUG
1764 0 0 if $Business::OnlinePayment::Litle::DEBUG
1767 0 0 if ($status_code =~ /^200/) { }
1769 0 0 if (not eval { do { $response = XMLin($page, 'ForceArray', ['caseActivity']) } }) { }
0 0 elsif (exists $response->{'response'} and $response->{'response'} == 1) { }
1790 0 0 if ($status_code =~ /^(?:900|599)/)
1804 0 0 if $Business::OnlinePayment::Litle::DEBUG
1823 0 0 unless $content{$key}
1869 0 0 if $Business::OnlinePayment::Litle::DEBUG
1882 0 0 if $Business::OnlinePayment::Litle::DEBUG
1885 0 0 if ($status_code =~ /^200/) { }
1887 0 0 unless (eval { do { $response = XMLin($page) } })
1891 0 0 if (exists $response->{'response'}) { }
1907 0 0 if ($status_code =~ /^(?:900|599)/)