line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::CaVirtex::API::Request; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
28
|
use 5.014002; |
|
1
|
|
|
|
|
36
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
55
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
5
|
use base qw(Finance::CaVirtex::API::DefaultPackage); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
101
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
6
|
use constant URL => 'https://cavirtex.com/api2/'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
56
|
|
12
|
1
|
|
|
1
|
|
4
|
use constant REQUEST_TYPE => 'POST'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
13
|
1
|
|
|
1
|
|
5
|
use constant CONTENT_TYPE => 'application/x-www-form-urlencoded'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
48
|
|
14
|
1
|
|
|
1
|
|
5
|
use constant ATTRIBUTES => qw(); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
15
|
1
|
|
|
1
|
|
6
|
use constant READY_TO_SEND => 0; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
40
|
|
16
|
1
|
|
|
1
|
|
6
|
use constant IS_PRIVATE => 1; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
50
|
|
17
|
1
|
|
|
1
|
|
6
|
use constant DATA_KEY => undef; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
219
|
|
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
0
|
0
|
0
|
sub url { URL } |
20
|
0
|
|
|
0
|
0
|
0
|
sub request_type { REQUEST_TYPE } |
21
|
0
|
|
|
0
|
0
|
0
|
sub content_type { CONTENT_TYPE } |
22
|
0
|
|
|
0
|
0
|
0
|
sub attributes { ATTRIBUTES } |
23
|
0
|
|
|
0
|
0
|
0
|
sub is_ready_to_send { READY_TO_SEND } |
24
|
0
|
|
|
0
|
0
|
0
|
sub is_private { IS_PRIVATE } |
25
|
0
|
|
|
0
|
0
|
0
|
sub data_key { DATA_KEY } |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
## dump all the fields as a hash... |
28
|
|
|
|
|
|
|
#sub request_content { |
29
|
|
|
|
|
|
|
#my $self = shift; |
30
|
|
|
|
|
|
|
#my %content; |
31
|
|
|
|
|
|
|
#foreach my $field ($self->attributes) { |
32
|
|
|
|
|
|
|
#$content{$field} = $self->$field if defined $self->$field; |
33
|
|
|
|
|
|
|
#} |
34
|
|
|
|
|
|
|
#return %content; |
35
|
|
|
|
|
|
|
#} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# dump all the fields as a hashref... |
38
|
|
|
|
|
|
|
sub request_content { |
39
|
3
|
|
|
3
|
0
|
6
|
my $self = shift; |
40
|
3
|
|
|
|
|
8
|
my $content = {}; |
41
|
3
|
|
|
|
|
13
|
foreach my $field ($self->attributes) { |
42
|
6
|
100
|
|
|
|
24
|
$content->{$field} = $self->$field if defined $self->$field; |
43
|
|
|
|
|
|
|
} |
44
|
3
|
|
|
|
|
18
|
return $content; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |