line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package UkrMoney::API; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
29104
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
5
|
1
|
|
|
1
|
|
857
|
use LWP::Simple; |
|
1
|
|
|
|
|
686894
|
|
|
1
|
|
|
|
|
10
|
|
6
|
1
|
|
|
1
|
|
2043
|
use XML::Simple; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.01'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
|
|
|
|
|
|
my $class = shift; |
13
|
|
|
|
|
|
|
$class = ref ($class) || $class; |
14
|
|
|
|
|
|
|
my $self = {}; |
15
|
|
|
|
|
|
|
return bless $self, $class; |
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub login{ |
19
|
|
|
|
|
|
|
my $self = shift; |
20
|
|
|
|
|
|
|
my $param = shift; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $xml = XMLin(get("https://api.ukrmoney.com/login/?pc_pwd=".$param->{'password'}."&pc_email=".$param->{'login'}), KeepRoot => 1); |
23
|
|
|
|
|
|
|
$self->{'param'}->{'session'} = $xml->{'login'}->{'session'}; |
24
|
|
|
|
|
|
|
return $xml->{'login'}->{'session'}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub trans{ |
29
|
|
|
|
|
|
|
my $self = shift; |
30
|
|
|
|
|
|
|
my $param = shift; |
31
|
|
|
|
|
|
|
$param->{'session'} = $self->{'param'}->{'session'} unless $param->{'session'}; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
my $xml = XMLin(get("https://api.ukrmoney.com/newtrans/?".($param->{'payee_purse'} ? "payee_purse=".$param->{'payee_purse'}."&" : "")."amnt=".$param->{'amount'}."&word=".$param->{'description'}."&pcsl_session_id=".$param->{'session'}."&benef_email=".$param->{'benef_email'}.($param->{'benef_purse'} ? "&benef_purse=".$param->{'benef_purse'} : "")."&mode=".$param->{'mode'}), KeepRoot => 1); |
34
|
|
|
|
|
|
|
return $xml->{'status'}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub trans_info{ |
38
|
|
|
|
|
|
|
my $self = shift; |
39
|
|
|
|
|
|
|
my $param = shift; |
40
|
|
|
|
|
|
|
$param->{'session'} = $self->{'param'}->{'session'} unless $param->{'session'}; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $xml = XMLin(get("https://api.ukrmoney.com/view_trans_info/?trans_id=".$param->{'trans_id'}."&pcsl_session_id=".$param->{'session'}), KeepRoot => 1); |
43
|
|
|
|
|
|
|
return $xml; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub trans_list{ |
47
|
|
|
|
|
|
|
my $self = shift; |
48
|
|
|
|
|
|
|
my $param = shift; |
49
|
|
|
|
|
|
|
$param->{'session'} = $self->{'param'}->{'session'} unless $param->{'session'}; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
my $xml = XMLin(get("https://api.ukrmoney.com/trans_list/?pcp_purse=".$param->{'purse'}."&offset=".$param->{'offset'}."&limit=".$param->{'limit'}."&pcsl_session_id=".$param->{'session'}), KeepRoot => 1); |
52
|
|
|
|
|
|
|
return $xml; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub my_info{ |
56
|
|
|
|
|
|
|
my $self = shift; |
57
|
|
|
|
|
|
|
my $param = shift; |
58
|
|
|
|
|
|
|
$param->{'session'} = $self->{'param'}->{'session'} unless $param->{'session'}; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
my $xml = XMLin(get("https://api.ukrmoney.com/account/?pcsl_session_id=".$param->{'session'}), KeepRoot => 1); |
61
|
|
|
|
|
|
|
return $xml; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub check_user{ |
65
|
|
|
|
|
|
|
my $self = shift; |
66
|
|
|
|
|
|
|
my $param = shift; |
67
|
|
|
|
|
|
|
$param->{'session'} = $self->{'param'}->{'session'} unless $param->{'session'}; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
my $result = $self->trans({'payee_purse' => $param->{'payee_purse'} ? $param->{'payee_purse'} : "", |
70
|
|
|
|
|
|
|
'amount' => '0.01', |
71
|
|
|
|
|
|
|
'description' => 'check for user', |
72
|
|
|
|
|
|
|
'benef_email' => $param->{'email'}, |
73
|
|
|
|
|
|
|
'pcsl_session_id' => $param->{'session'}, |
74
|
|
|
|
|
|
|
'mode' => 'test'}); |
75
|
|
|
|
|
|
|
return ($result->{'status'} eq 'ok') ? 1 : 0; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |
80
|
|
|
|
|
|
|
__END__ |