File Coverage

blib/lib/WebService/MinFraud/Record/ShippingAddress.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package WebService::MinFraud::Record::ShippingAddress;
2              
3 4     4   179895 use Moo;
  4         16442  
  4         25  
4 4     4   2597 use namespace::autoclean;
  4         11000  
  4         44  
5              
6             our $VERSION = '1.009001';
7              
8 4     4   769 use WebService::MinFraud::Types qw( Bool BoolCoercion Num);
  4         10  
  4         506  
9              
10             with 'WebService::MinFraud::Role::Record::Address';
11              
12             has distance_to_billing_address => (
13             is => 'ro',
14             isa => Num,
15             predicate => 1,
16             );
17              
18             has is_high_risk => (
19             is => 'ro',
20             isa => Bool,
21             coerce => BoolCoercion,
22             predicate => 1,
23             );
24              
25             1;
26              
27             # ABSTRACT: Contains data for the shipping address record associated with a transaction
28              
29             __END__
30              
31             =pod
32              
33             =encoding UTF-8
34              
35             =head1 NAME
36              
37             WebService::MinFraud::Record::ShippingAddress - Contains data for the shipping address record associated with a transaction
38              
39             =head1 VERSION
40              
41             version 1.009001
42              
43             =head1 SYNOPSIS
44              
45             use 5.010;
46              
47             use WebService::MinFraud::Client;
48              
49             my $client = WebService::MinFraud::Client->new(
50             account_id => 42,
51             license_key => 'abcdef123456',
52             );
53             my $request = { device => { ip_address => '24.24.24.24' } };
54             my $insights = $client->insights($request);
55             my $shipping_address = $insights->shipping_address;
56             say $shipping_address->distance_to_ip_location;
57              
58             =head1 DESCRIPTION
59              
60             This class contains the shipping address data associated with a transaction.
61              
62             This record is returned by the Insights web service.
63              
64             =head1 METHODS
65              
66             This class provides the following methods:
67              
68             =head2 distance_to_billing_address
69              
70             Returns the distance in kilometers from the shipping address to the billing
71             address.
72              
73             =head2 distance_to_ip_location
74              
75             Returns the distance in kilometers from the shipping address to the location of
76             the IP address.
77              
78             =head2 is_high_risk
79              
80             Returns a boolean indicating whether the shipping address is considered high
81             risk.
82              
83             =head2 is_in_ip_country
84              
85             Returns a boolean indicating whether the shipping address is in the same
86             country as that of the IP address.
87              
88             =head2 is_postal_in_city
89              
90             Returns a boolean indicating whether the shipping postal code is in the
91             shipping city.
92              
93             =head2 latitude
94              
95             Returns the latitude of the shipping address.
96              
97             =head2 longitude
98              
99             Returns the longitude of the shipping address.
100              
101             =head1 PREDICATE METHODS
102              
103             The following predicate methods are available, which return true if the related
104             data was present in the response body, false if otherwise:
105              
106             =head2 has_distance_to_billing_address
107              
108             =head2 has_distance_to_ip_location
109              
110             =head2 has_is_high_risk
111              
112             =head2 has_is_in_ip_country
113              
114             =head2 has_is_postal_in_city
115              
116             =head2 has_latitude
117              
118             =head2 has_longitude
119              
120             =head1 SUPPORT
121              
122             Bugs may be submitted through L<https://github.com/maxmind/minfraud-api-perl/issues>.
123              
124             =head1 AUTHOR
125              
126             Mateu Hunter <mhunter@maxmind.com>
127              
128             =head1 COPYRIGHT AND LICENSE
129              
130             This software is copyright (c) 2015 - 2019 by MaxMind, Inc.
131              
132             This is free software; you can redistribute it and/or modify it under
133             the same terms as the Perl 5 programming language system itself.
134              
135             =cut