| 1 | package Business::BancaSella::Decode::Gateway; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 2 | push @ISA,'Business::BancaSella::Gateway'; | |||||||||||||||||||||||||||
| 4 | 2 | ▶ | use Business::BancaSella::Gateway; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use URI; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 2 | $VERSION = "0.11"; | |||||||||||||||||||||||||||
| 10 | 0 | ▶ | sub Version { $VERSION; } | ||||||||||||||||||||||||||
|
Subroutine
Version: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | 2 | require 5.004; | |||||||||||||||||||||||||||
| 12 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 2 | my %fields = | |||||||||||||||||||||||||||
| 16 | ( | ||||||||||||||||||||||||||||
| 17 | query_string => undef | ||||||||||||||||||||||||||||
| 18 | ); | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 2 | my @fields_req = qw/query_string/; | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | sub new | ||||||||||||||||||||||||||||
| 23 | 2 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||
| 24 | 2 | my $proto = shift; | |||||||||||||||||||||||||||
| 25 | 2 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||||||||||
|
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||||||||||
| 26 | 2 | my $self = {}; | |||||||||||||||||||||||||||
| 27 | 2 | bless $self,$class; | |||||||||||||||||||||||||||
| 28 | 2 | $self->init(@_); | |||||||||||||||||||||||||||
| 29 | 2 | return $self; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 3 | ▶ | sub init { | ||||||||||||||||||||||||||
|
Subroutine
init: called CC=6 SCAR=18.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 33 | 3 | my $self = shift; | |||||||||||||||||||||||||||
| 34 | 3 | my (%options) = @_; | |||||||||||||||||||||||||||
| 35 | # Assign default options | ||||||||||||||||||||||||||||
| 36 | 3 | ▶ | while (my ($key,$value) = each(%fields)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 37 | 3 | ▶ | $self->{$key} = $self->{$key} || $value; | ||||||||||||||||||||||||||
|
Condition66%2/3
$self->{$key} || $value
MC/DC50%1/2
$self->{$key} || $value
$self->{$key}
$value
Truth table66%2/3
A || B
A= $self->{$key}B= $value
| |||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | # Assign options | ||||||||||||||||||||||||||||
| 40 | 3 | ▶ | while (my ($key,$value) = each(%options)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 41 | 4 | $self->{$key} = $value; | |||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | # Check required params | ||||||||||||||||||||||||||||
| 44 | 3 | foreach (@fields_req) { | |||||||||||||||||||||||||||
| 45 | croak "You must declare '$_' in " . ref($self) . "::new" | ||||||||||||||||||||||||||||
| 46 | 3 | ▶ | if (!defined $self->{$_}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | 3 | $self->_split_uri; | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 3 | ▶ | sub _split_uri { | ||||||||||||||||||||||||||
|
Subroutine
_split_uri: called CC=4 SCAR=14.1
| |||||||||||||||||||||||||||||
| 52 | 3 | my $self = shift; | |||||||||||||||||||||||||||
| 53 | 3 | my $qs = '?' . $self->query_string; | |||||||||||||||||||||||||||
| 54 | 3 | my %qs = URI->new($qs)->query_form; | |||||||||||||||||||||||||||
| 55 | die "Malformed uri definition: " . $self->{uri} | ||||||||||||||||||||||||||||
| 56 | 3 | ▶ | if (!(exists $qs{a} && exists $qs{b})); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
exists $qs{"a"} and exists $qs{"b"}
MC/DC0%0/2
exists $qs{"a"} and exists $qs{"b"}
exists $qs{"a"}
exists $qs{"b"}
Truth table33%1/3
A and B
A= exists $qs{"a"}B= exists $qs{"b"}
| |||||||||||||||||||||||||||||
| 57 | 3 | $self->{result} = $qs{a}; | |||||||||||||||||||||||||||
| 58 | 3 | $self->{id} = $qs{b}; | |||||||||||||||||||||||||||
| 59 | 3 | $self->{otp} = $qs{c}; | |||||||||||||||||||||||||||
| 60 | 3 | ▶ | if ($self->{result} ne 'KO') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 61 | 1 | $self->{authcode} = $qs{a}; | |||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 5 | ▶ | sub result { | ||||||||||||||||||||||||||
|
Subroutine
result: called CC=2 SCAR=7.6
Pod
documented
| |||||||||||||||||||||||||||||
| 67 | 5 | my $self = shift; | |||||||||||||||||||||||||||
| 68 | 0 | ▶ | if (@_) { $self->SUPER::result(shift) }; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 69 | 5 | return $self->SUPER::result ne 'KO'; | |||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 3 | ▶ | sub query_string { my $s=shift; return @_ ? ($s->{query_string}=shift) : $s->{query_string} } | ||||||||||||||||||||||||||
|
Subroutine
query_string: called CC=2 SCAR=7.2
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | # Preloaded methods go here. | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | 2 | 1; | |||||||||||||||||||||||||||
| 77 | __END__ | ||||||||||||||||||||||||||||