File Coverage

blib/lib/WebService/MinFraud/Validator/FraudService.pm
Criterion Covered Total %
statement 35 35 100.0
branch n/a
condition n/a
subroutine 13 13 100.0
pod n/a
total 48 48 100.0


line stmt bran cond sub pod time code
1             package WebService::MinFraud::Validator::FraudService;
2              
3 2     2   982 use Moo;
  2         5  
  2         10  
4 2     2   572 use namespace::autoclean;
  2         4  
  2         11  
5              
6 2     2   116 use Data::Rx;
  2         3  
  2         61  
7 2     2   836 use WebService::MinFraud::Data::Rx::Type::CCToken;
  2         6  
  2         59  
8 2     2   812 use WebService::MinFraud::Data::Rx::Type::CustomInputs;
  2         5  
  2         55  
9 2     2   830 use WebService::MinFraud::Data::Rx::Type::DateTime::RFC3339;
  2         8  
  2         71  
10 2     2   13 use WebService::MinFraud::Data::Rx::Type::Enum;
  2         4  
  2         52  
11 2     2   1143 use WebService::MinFraud::Data::Rx::Type::Hex32;
  2         8  
  2         80  
12 2     2   938 use WebService::MinFraud::Data::Rx::Type::Hostname;
  2         7  
  2         61  
13 2     2   14 use WebService::MinFraud::Data::Rx::Type::IPAddress;
  2         4  
  2         49  
14 2     2   860 use WebService::MinFraud::Data::Rx::Type::WebURI;
  2         6  
  2         896  
15              
16             our $VERSION = '1.010000';
17              
18             extends 'WebService::MinFraud::Validator::Base';
19              
20             sub _build_rx_plugins {
21 42     42   1150 Data::Rx->new(
22             {
23             prefix => {
24             maxmind => 'tag:maxmind.com,MAXMIND:rx/',
25             },
26             type_plugins => [
27             qw(
28             WebService::MinFraud::Data::Rx::Type::CCToken
29             WebService::MinFraud::Data::Rx::Type::CustomInputs
30             WebService::MinFraud::Data::Rx::Type::DateTime::RFC3339
31             WebService::MinFraud::Data::Rx::Type::Enum
32             WebService::MinFraud::Data::Rx::Type::Hex32
33             WebService::MinFraud::Data::Rx::Type::Hostname
34             WebService::MinFraud::Data::Rx::Type::IPAddress
35             WebService::MinFraud::Data::Rx::Type::WebURI
36             )
37             ],
38             },
39             );
40             }
41              
42             sub _build_request_schema_definition {
43             return {
44 42     42   9224 type => '//rec',
45             required => {
46             device => {
47             type => '//rec',
48             required => {
49             ip_address => {
50             type => '/maxmind/ip',
51             },
52             },
53             optional => {
54             user_agent => '//str',
55             accept_language => '//str',
56             session_age => '//num',
57             session_id => {
58             type => '//str',
59             length => { min => 1, max => 255, },
60             },
61             },
62             },
63             },
64             optional => {
65             account => {
66             type => '//rec',
67             optional => {
68             user_id => '//str',
69             username_md5 => '/maxmind/hex32',
70             },
71             },
72             billing => {
73             type => '//rec',
74             optional => {
75             first_name => '//str',
76             last_name => '//str',
77             company => '//str',
78             address => '//str',
79             address_2 => '//str',
80             city => '//str',
81             region => {
82             type => '//str',
83             length => { 'min' => 1, 'max' => 4 },
84             },
85             country => {
86             type => '//str',
87             length => { 'min' => 2, 'max' => 2 },
88             },
89             postal => '//str',
90             phone_number => '//str',
91             phone_country_code => '//int',
92             },
93             },
94             credit_card => {
95             type => '//rec',
96             optional => {
97             avs_result => {
98             type => '//str',
99             length => { 'min' => 1, 'max' => 1 },
100             },
101             bank_name => '//str',
102             bank_phone_country_code => '//int',
103             bank_phone_number => '//str',
104             cvv_result => {
105             type => '//str',
106             length => { 'min' => 1, 'max' => 1 },
107             },
108             issuer_id_number => {
109             type => '//str',
110             length => { 'min' => 6, 'max' => 6 },
111             },
112             last_4_digits => {
113             type => '//str',
114             length => { 'min' => 4, 'max' => 4 },
115             },
116             token => '/maxmind/cctoken',
117             },
118             },
119             custom_inputs => {
120             type => '/maxmind/custom_inputs',
121             },
122             email => {
123             type => '//rec',
124             optional => {
125             address => '//str',
126             domain => '/maxmind/hostname',
127             },
128             },
129             event => {
130             type => '//rec',
131             optional => {
132             transaction_id => '//str',
133             shop_id => '//str',
134             time => '/maxmind/datetime/rfc3339',
135             type => {
136             type => '/maxmind/enum',
137             contents => {
138             type => '//str',
139             values => [
140             'account_creation',
141             'account_login',
142             'email_change',
143             'password_reset',
144             'payout_change',
145             'purchase',
146             'recurring_purchase',
147             'referral',
148             'survey',
149             ],
150             },
151             },
152             },
153             },
154             order => {
155             type => '//rec',
156             optional => {
157             amount => '//num',
158             currency => {
159             type => '//str',
160             length => { 'min' => 3, 'max' => 3 },
161             },
162             discount_code => '//str',
163             affiliate_id => '//str',
164             subaffiliate_id => '//str',
165             referrer_uri => '/maxmind/weburi',
166             is_gift => '//bool',
167             has_gift_message => '//bool',
168             },
169             },
170             payment => {
171             type => '//rec',
172             optional => {
173             processor => {
174             type => '/maxmind/enum',
175             contents => {
176             type => '//str',
177             values => [
178             'adyen',
179             'altapay',
180             'amazon_payments',
181             'american_express_payment_gateway',
182             'authorizenet',
183             'balanced',
184             'beanstream',
185             'bluepay',
186             'bluesnap',
187             'bpoint',
188             'braintree',
189             'ccavenue',
190             'ccnow',
191             'chase_paymentech',
192             'checkout_com',
193             'cielo',
194             'collector',
195             'commdoo',
196             'compropago',
197             'concept_payments',
198             'conekta',
199             'ct_payments',
200             'cuentadigital',
201             'curopayments',
202             'cybersource',
203             'dalenys',
204             'dalpay',
205             'datacash',
206             'dibs',
207             'digital_river',
208             'ebs',
209             'ecomm365',
210             'elavon',
211             'emerchantpay',
212             'epay',
213             'eprocessing_network',
214             'eway',
215             'exact',
216             'first_data',
217             'global_payments',
218             'gocardless',
219             'heartland',
220             'hipay',
221             'ingenico',
222             'internetsecure',
223             'intuit_quickbooks_payments',
224             'iugu',
225             'lemon_way',
226             'mastercard_payment_gateway',
227             'mercadopago',
228             'merchant_esolutions',
229             'mirjeh',
230             'mollie',
231             'moneris_solutions',
232             'nmi',
233             'oceanpayment',
234             'oney',
235             'openpaymx',
236             'optimal_payments',
237             'orangepay',
238             'other',
239             'pacnet_services',
240             'payeezy',
241             'payfast',
242             'paygate',
243             'paylike',
244             'payment_express',
245             'paymentwall',
246             'payone',
247             'paypal',
248             'payplus',
249             'paystation',
250             'paytrace',
251             'paytrail',
252             'payture',
253             'payu',
254             'payulatam',
255             'payway',
256             'payza',
257             'pinpayments',
258             'posconnect',
259             'princeton_payment_solutions',
260             'psigate',
261             'qiwi',
262             'quickpay',
263             'raberil',
264             'rede',
265             'redpagos',
266             'rewardspay',
267             'sagepay',
268             'securetrading',
269             'simplify_commerce',
270             'skrill',
271             'smartcoin',
272             'smartdebit',
273             'solidtrust_pay',
274             'sps_decidir',
275             'stripe',
276             'synapsefi',
277             'telerecargas',
278             'towah',
279             'transact_pro',
280             'usa_epay',
281             'vantiv',
282             'verepay',
283             'vericheck',
284             'vindicia',
285             'virtual_card_services',
286             'vme',
287             'vpos',
288             'wirecard',
289             'worldpay',
290             ],
291              
292             },
293             },
294             was_authorized => '//bool',
295             decline_code => '//str',
296             },
297             },
298             shipping => {
299             type => '//rec',
300             optional => {
301             first_name => '//str',
302             last_name => '//str',
303             company => '//str',
304             address => '//str',
305             address_2 => '//str',
306             city => '//str',
307             delivery_speed => {
308             type => '/maxmind/enum',
309             contents => {
310             type => '//str',
311             values => [
312             'same_day', 'overnight',
313             'expedited', 'standard',
314             ],
315             },
316             },
317             region => {
318             type => '//str',
319             length => { 'min' => 1, 'max' => 4 },
320             },
321             country => {
322             type => '//str',
323             length => { 'min' => 2, 'max' => 2 },
324             },
325             postal => '//str',
326             phone_number => '//str',
327             phone_country_code => {
328             type => '//str',
329             length => { 'min' => 1, 'max' => 4 },
330             },
331             },
332             },
333             shopping_cart => {
334             type => '//arr',
335             contents => {
336             type => '//rec',
337             optional => {
338             category => '//str',
339             item_id => '//str',
340             quantity => '//int',
341             price => '//num',
342             },
343             },
344             },
345             },
346             };
347             }
348              
349             1;
350              
351             # ABSTRACT: Parent Validation for the minFraud FraudServices
352              
353             __END__
354              
355             =pod
356              
357             =encoding UTF-8
358              
359             =head1 NAME
360              
361             WebService::MinFraud::Validator::FraudService - Parent Validation for the minFraud FraudServices
362              
363             =head1 VERSION
364              
365             version 1.010000
366              
367             =head1 SUPPORT
368              
369             Bugs may be submitted through L<https://github.com/maxmind/minfraud-api-perl/issues>.
370              
371             =head1 AUTHOR
372              
373             Mateu Hunter <mhunter@maxmind.com>
374              
375             =head1 COPYRIGHT AND LICENSE
376              
377             This software is copyright (c) 2015 - 2020 by MaxMind, Inc.
378              
379             This is free software; you can redistribute it and/or modify it under
380             the same terms as the Perl 5 programming language system itself.
381              
382             =cut