File Coverage

blib/lib/WebService/MinFraud/Validator/Chargeback.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod n/a
total 24 24 100.0


line stmt bran cond sub pod time code
1             package WebService::MinFraud::Validator::Chargeback;
2              
3 2     2   13 use Moo;
  2         5  
  2         16  
4 2     2   629 use namespace::autoclean;
  2         5  
  2         18  
5              
6 2     2   981 use Data::Rx;
  2         36954  
  2         69  
7 2     2   867 use WebService::MinFraud::Data::Rx::Type::Enum;
  2         5  
  2         68  
8 2     2   828 use WebService::MinFraud::Data::Rx::Type::IPAddress;
  2         8  
  2         353  
9              
10             our $VERSION = '1.010000';
11              
12             extends 'WebService::MinFraud::Validator::Base';
13              
14             sub _build_rx_plugins {
15 15     15   344 Data::Rx->new(
16             {
17             prefix => {
18             maxmind => 'tag:maxmind.com,MAXMIND:rx/',
19             },
20             type_plugins => [
21             qw(
22             WebService::MinFraud::Data::Rx::Type::Enum
23             WebService::MinFraud::Data::Rx::Type::IPAddress
24             )
25             ],
26             },
27             );
28             }
29              
30             sub _build_request_schema_definition {
31             return {
32 15     15   1749 type => '//rec',
33             required => {
34             ip_address => {
35             type => '/maxmind/ip',
36             },
37             },
38             optional => {
39             chargeback_code => '//str',
40             tag => {
41             type => '/maxmind/enum',
42             contents => {
43             type => '//str',
44             values => [
45             'not_fraud',
46             'suspected_fraud',
47             'spam_or_abuse',
48             'chargeback',
49             ],
50             },
51             },
52             maxmind_id => {
53             type => '//str',
54             length => { 'min' => 8, 'max' => 8 },
55             },
56             minfraud_id => {
57             type => '//str',
58             length => { 'min' => 36, 'max' => 36 },
59             },
60             transaction_id => '//str',
61             },
62             };
63             }
64              
65             1;
66              
67             # ABSTRACT: Validation for the minFraud Chargeback
68              
69             __END__
70              
71             =pod
72              
73             =encoding UTF-8
74              
75             =head1 NAME
76              
77             WebService::MinFraud::Validator::Chargeback - Validation for the minFraud Chargeback
78              
79             =head1 VERSION
80              
81             version 1.010000
82              
83             =head1 SUPPORT
84              
85             Bugs may be submitted through L<https://github.com/maxmind/minfraud-api-perl/issues>.
86              
87             =head1 AUTHOR
88              
89             Mateu Hunter <mhunter@maxmind.com>
90              
91             =head1 COPYRIGHT AND LICENSE
92              
93             This software is copyright (c) 2015 - 2020 by MaxMind, Inc.
94              
95             This is free software; you can redistribute it and/or modify it under
96             the same terms as the Perl 5 programming language system itself.
97              
98             =cut