File Coverage

blib/lib/WebService/MinFraud/Model/Score.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 18 18 100.0


line stmt bran cond sub pod time code
1             package WebService::MinFraud::Model::Score;
2              
3 2     2   110495 use Moo;
  2         8623  
  2         10  
4 2     2   1970 use namespace::autoclean;
  2         9443  
  2         14  
5              
6             our $VERSION = '1.010000';
7              
8 2     2   529 use WebService::MinFraud::Record::Disposition;
  2         6  
  2         53  
9 2     2   763 use WebService::MinFraud::Record::ScoreIPAddress;
  2         6  
  2         189  
10              
11             with 'WebService::MinFraud::Role::HasCommonAttributes',
12             'WebService::MinFraud::Role::HasLocales',
13             'WebService::MinFraud::Role::Model';
14              
15             ## no critic (ProhibitUnusedPrivateSubroutines)
16 8     8   543 sub _has { has(@_) }
17             ## use critic
18              
19             __PACKAGE__->_define_model_attributes(
20             disposition => 'Disposition',
21             ip_address => 'ScoreIPAddress',
22             );
23              
24             1;
25              
26             # ABSTRACT: Model class for minFraud: Score
27              
28             __END__
29              
30             =pod
31              
32             =encoding UTF-8
33              
34             =head1 NAME
35              
36             WebService::MinFraud::Model::Score - Model class for minFraud: Score
37              
38             =head1 VERSION
39              
40             version 1.010000
41              
42             =head1 SYNOPSIS
43              
44             use 5.010;
45              
46             use WebService::MinFraud::Client;
47              
48             my $client = WebService::MinFraud::Client->new(
49             account_id => 42,
50             license_key => 'abcdef123456',
51             );
52              
53             my $request = { device => { ip_address => '24.24.24.24' } };
54             my $score = $client->score($request);
55             say $score->risk_score;
56              
57             =head1 DESCRIPTION
58              
59             This class provides a model for the data returned by the minFraud Score
60             web service.
61              
62             For more details, see the L<API
63             documentation|https://dev.maxmind.com/minfraud/>.
64              
65             =head1 METHODS
66              
67             This class provides the following methods:
68              
69             =head2 disposition
70              
71             Returns a L<WebService::MinFraud::Record::Disposition> object representing the
72             disposition set for the transaction using custom rules.
73              
74             =head2 funds_remaining
75              
76             Returns the I<approximate> US dollar value of the funds remaining on your
77             account. The fund calculation is near realtime so it may not be exact.
78              
79             =head2 id
80              
81             Returns a UUID that identifies the minFraud request. Please use this UUID in
82             bug reports or support requests to MaxMind so that we can easily identify a
83             particular request.
84              
85             =head2 ip_address
86              
87             Returns a L<WebService::MinFraud::Record::ScoreIPAddress> object representing
88             IP address data for the transaction.
89              
90             =head2 queries_remaining
91              
92             Returns the I<approximate> number of queries remaining for this service before
93             your account runs out of funds. The query counts are near realtime so they may
94             not be exact.
95              
96             =head2 risk_score
97              
98             Returns the risk score which is a number between 0.01 and 99. A higher score
99             indicates a higher risk of fraud.
100              
101             =head2 warnings
102              
103             Returns an ArrayRef of L<WebService::MinFraud::Record::Warning> objects. It is
104             B<highly recommended that you check this array> for issues when integrating the
105             web service.
106              
107             =head1 PREDICATE METHODS
108              
109             The following predicate methods are available, which return true if the related
110             data was present in the response body, false if otherwise:
111              
112             =head2 has_funds_remaining
113              
114             =head2 has_id
115              
116             =head2 has_queries_remaining
117              
118             =head2 has_risk_score
119              
120             =head2 has_warnings
121              
122             =head1 SUPPORT
123              
124             Bugs may be submitted through L<https://github.com/maxmind/minfraud-api-perl/issues>.
125              
126             =head1 AUTHOR
127              
128             Mateu Hunter <mhunter@maxmind.com>
129              
130             =head1 COPYRIGHT AND LICENSE
131              
132             This software is copyright (c) 2015 - 2020 by MaxMind, Inc.
133              
134             This is free software; you can redistribute it and/or modify it under
135             the same terms as the Perl 5 programming language system itself.
136              
137             =cut