line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Business::OnlinePayment::Litle::UpdaterResponse; |
2
|
1
|
|
|
1
|
|
7078
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
41
|
|
3
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
512
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# ABSTRACT: Business::OnlinePayment::Litle::UpdaterResponse |
6
|
|
|
|
|
|
|
our $VERSION = '0.958'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new{ |
10
|
1
|
|
|
1
|
1
|
521
|
my ($class, $args) = @_; |
11
|
1
|
|
|
|
|
5
|
my $self = bless $args, $class; |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
|
|
7
|
$self->_build_subs( |
14
|
|
|
|
|
|
|
qw( cust_id order_number invoice_number batch_date result_code |
15
|
|
|
|
|
|
|
new_card_token old_cardnum old_type old_expdate |
16
|
|
|
|
|
|
|
error_message is_success type is_updated new_cardnum new_expdate new_type)); |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
59
|
$self->order_number( $args->{'litleTxnId'}); |
19
|
1
|
|
|
|
|
41
|
$self->invoice_number( $args->{'orderId'}); |
20
|
1
|
|
|
|
|
39
|
$self->batch_date( $args->{'responseTime'}); |
21
|
1
|
|
|
|
|
39
|
$self->result_code( $args->{'response'}); |
22
|
1
|
|
|
|
|
40
|
$self->error_message( $args->{'message'}); |
23
|
1
|
|
|
|
|
42
|
$self->cust_id( $args->{'customerId'}); |
24
|
1
|
50
|
|
|
|
41
|
$self->type( $args->{'originalCard'} ? 'confirm' : 'auth' ); |
25
|
1
|
|
|
|
|
40
|
$self->is_updated(0); |
26
|
1
|
50
|
|
|
|
4
|
if ( $args->{'originalCard'} ) { |
27
|
1
|
|
|
|
|
38
|
$self->old_cardnum( $args->{'originalCard'}->{'number'} ); |
28
|
1
|
|
|
|
|
41
|
$self->old_type( $args->{'originalCard'}->{'type'} ); |
29
|
1
|
|
|
|
|
39
|
$self->old_expdate( $args->{'originalCard'}->{'expDate'} ); |
30
|
|
|
|
|
|
|
} |
31
|
1
|
50
|
|
|
|
38
|
if ( $self->type eq 'confirm' ){ |
32
|
1
|
50
|
33
|
|
|
12
|
if ( $args->{'updatedToken'} ) { |
|
|
50
|
|
|
|
|
|
33
|
0
|
|
|
|
|
0
|
$self->new_card_token( $args->{'updatedToken'}->{'litleToken'} ); |
34
|
0
|
|
|
|
|
0
|
$self->new_type( $args->{'updatedToken'}->{'type'} ); |
35
|
0
|
|
|
|
|
0
|
$self->new_expdate( $args->{'updatedToken'}->{'expDate'} ); |
36
|
0
|
|
|
|
|
0
|
$self->is_updated(1); |
37
|
|
|
|
|
|
|
} elsif ( $args->{'updatedCard'}->{'number'} && $args->{'updatedCard'}->{'number'} ne 'N/A' ) { |
38
|
1
|
|
|
|
|
39
|
$self->new_cardnum( $args->{'updatedCard'}->{'number'} ); |
39
|
1
|
|
|
|
|
51
|
$self->new_type( $args->{'updatedCard'}->{'type'} ); |
40
|
1
|
|
|
|
|
45
|
$self->new_expdate( $args->{'updatedCard'}->{'expDate'} ); |
41
|
1
|
|
|
|
|
37
|
$self->is_updated(1); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
38
|
$self->is_success(1); |
46
|
1
|
|
|
|
|
5
|
return $self; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub _build_subs { |
50
|
1
|
|
|
1
|
|
4
|
my $self = shift; |
51
|
|
|
|
|
|
|
|
52
|
1
|
|
|
|
|
4
|
foreach(@_) { |
53
|
16
|
50
|
|
|
|
152
|
next if($self->can($_)); |
54
|
16
|
50
|
|
1
|
0
|
1138
|
eval "s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