line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::AMEX::Transaction::CBNOT; |
2
|
|
|
|
|
|
|
$Finance::AMEX::Transaction::CBNOT::VERSION = '0.003'; |
3
|
7
|
|
|
7
|
|
46
|
use strict; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
187
|
|
4
|
7
|
|
|
7
|
|
31
|
use warnings; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
176
|
|
5
|
|
|
|
|
|
|
|
6
|
7
|
|
|
7
|
|
3027
|
use Finance::AMEX::Transaction::CBNOT::Header; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
201
|
|
7
|
7
|
|
|
7
|
|
4171
|
use Finance::AMEX::Transaction::CBNOT::Detail; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
186
|
|
8
|
7
|
|
|
7
|
|
3046
|
use Finance::AMEX::Transaction::CBNOT::Trailer; |
|
7
|
|
|
|
|
18
|
|
|
7
|
|
|
|
|
170
|
|
9
|
7
|
|
|
7
|
|
2872
|
use Finance::AMEX::Transaction::CBNOT::Unknown; |
|
7
|
|
|
|
|
20
|
|
|
7
|
|
|
|
|
1157
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# ABSTRACT: Parse AMEX Chargeback Notification Files (CBNOT) |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
2
|
|
|
2
|
1
|
10
|
my ($class, %props) = @_; |
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
|
|
13
|
my $type_map = { |
17
|
|
|
|
|
|
|
H => 'Finance::AMEX::Transaction::CBNOT::Header', |
18
|
|
|
|
|
|
|
D => 'Finance::AMEX::Transaction::CBNOT::Detail', |
19
|
|
|
|
|
|
|
T => 'Finance::AMEX::Transaction::CBNOT::Trailer', |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
|
|
9
|
my $self = bless { |
23
|
|
|
|
|
|
|
_type_map => $type_map, |
24
|
|
|
|
|
|
|
}, $class; |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
9
|
return $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub parse_line { |
30
|
8
|
|
|
8
|
1
|
26
|
my ($self, $line) = @_; |
31
|
|
|
|
|
|
|
|
32
|
8
|
100
|
|
|
|
32
|
return if not defined $line; |
33
|
|
|
|
|
|
|
|
34
|
6
|
|
|
|
|
22
|
my $indicator = substr($line, 0, 1); |
35
|
6
|
50
|
|
|
|
31
|
if (exists $self->{_type_map}->{$indicator}) { |
36
|
6
|
|
|
|
|
86
|
return $self->{_type_map}->{$indicator}->new(line => $line); |
37
|
|
|
|
|
|
|
} |
38
|
0
|
|
|
|
|
|
return Finance::AMEX::Transaction::CBNOT::Unknown->new(line => $line); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |