line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::AMEX::Transaction::CBNOT; |
2
|
|
|
|
|
|
|
$Finance::AMEX::Transaction::CBNOT::VERSION = '0.004'; |
3
|
8
|
|
|
8
|
|
54
|
use strict; |
|
8
|
|
|
|
|
18
|
|
|
8
|
|
|
|
|
233
|
|
4
|
8
|
|
|
8
|
|
42
|
use warnings; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
193
|
|
5
|
|
|
|
|
|
|
|
6
|
8
|
|
|
8
|
|
3861
|
use Finance::AMEX::Transaction::CBNOT::Header; |
|
8
|
|
|
|
|
20
|
|
|
8
|
|
|
|
|
243
|
|
7
|
8
|
|
|
8
|
|
5577
|
use Finance::AMEX::Transaction::CBNOT::Detail; |
|
8
|
|
|
|
|
26
|
|
|
8
|
|
|
|
|
279
|
|
8
|
8
|
|
|
8
|
|
4954
|
use Finance::AMEX::Transaction::CBNOT::Trailer; |
|
8
|
|
|
|
|
22
|
|
|
8
|
|
|
|
|
231
|
|
9
|
8
|
|
|
8
|
|
4019
|
use Finance::AMEX::Transaction::CBNOT::Unknown; |
|
8
|
|
|
|
|
25
|
|
|
8
|
|
|
|
|
1393
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# ABSTRACT: Parse AMEX Chargeback Notification Files (CBNOT) |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
2
|
|
|
2
|
1
|
9
|
my ($class, %props) = @_; |
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
|
|
12
|
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
|
|
|
|
|
8
|
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
|
22
|
my ($self, $line) = @_; |
31
|
|
|
|
|
|
|
|
32
|
8
|
100
|
|
|
|
40
|
return if not defined $line; |
33
|
|
|
|
|
|
|
|
34
|
6
|
|
|
|
|
21
|
my $indicator = substr($line, 0, 1); |
35
|
6
|
50
|
|
|
|
33
|
if (exists $self->{_type_map}->{$indicator}) { |
36
|
6
|
|
|
|
|
83
|
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__ |