| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package WebService::MinFraud::Data::Rx::Type::CCToken; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 2 |  |  | 2 |  | 43 | use 5.010; | 
|  | 2 |  |  |  |  | 7 |  | 
| 4 |  |  |  |  |  |  |  | 
| 5 | 2 |  |  | 2 |  | 12 | use strict; | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 46 |  | 
| 6 | 2 |  |  | 2 |  | 10 | use warnings; | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 49 |  | 
| 7 | 2 |  |  | 2 |  | 11 | use namespace::autoclean; | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 19 |  | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | our $VERSION = '1.010000'; | 
| 10 |  |  |  |  |  |  |  | 
| 11 | 2 |  |  | 2 |  | 173 | use parent 'Data::Rx::CommonType::EasyNew'; | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 28 |  | 
| 12 |  |  |  |  |  |  |  | 
| 13 | 2 |  |  | 2 |  | 161 | use List::Util qw( all ); | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 142 |  | 
| 14 | 2 |  |  | 2 |  | 11 | use Role::Tiny::With; | 
|  | 2 |  |  |  |  | 5 |  | 
|  | 2 |  |  |  |  | 450 |  | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | with 'WebService::MinFraud::Role::Data::Rx::Type'; | 
| 17 |  |  |  |  |  |  |  | 
| 18 |  |  |  |  |  |  | sub assert_valid { | 
| 19 | 5 |  |  | 5 | 0 | 1076 | my ( $self, $value ) = @_; | 
| 20 |  |  |  |  |  |  |  | 
| 21 | 5 | 100 | 66 |  |  | 59 | return 1 | 
|  |  |  | 100 |  |  |  |  | 
|  |  |  | 100 |  |  |  |  | 
| 22 |  |  |  |  |  |  | if $value | 
| 23 |  |  |  |  |  |  | && ( length($value) < 256 ) | 
| 24 |  |  |  |  |  |  | && ( $value !~ m/^[0-9]{1,19}$/ ) | 
| 25 |  |  |  |  |  |  | && ( $value =~ m/^[\x21-\x7E]+$/ ); | 
| 26 |  |  |  |  |  |  |  | 
| 27 | 4 |  |  |  |  | 34 | $self->fail( | 
| 28 |  |  |  |  |  |  | { | 
| 29 |  |  |  |  |  |  | error => [qw(type)], | 
| 30 |  |  |  |  |  |  | message => | 
| 31 |  |  |  |  |  |  | 'Found value is not considered a valid credit card token.', | 
| 32 |  |  |  |  |  |  | value => $value, | 
| 33 |  |  |  |  |  |  | } | 
| 34 |  |  |  |  |  |  | ); | 
| 35 |  |  |  |  |  |  | } | 
| 36 |  |  |  |  |  |  |  | 
| 37 |  |  |  |  |  |  | sub type_uri { | 
| 38 |  |  |  |  |  |  | ## no critic(ValuesAndExpressions::ProhibitCommaSeparatedStatements) | 
| 39 | 42 |  |  | 42 | 0 | 23266 | 'tag:maxmind.com,MAXMIND:rx/cctoken'; | 
| 40 |  |  |  |  |  |  | } | 
| 41 |  |  |  |  |  |  |  | 
| 42 |  |  |  |  |  |  | 1; | 
| 43 |  |  |  |  |  |  |  | 
| 44 |  |  |  |  |  |  | # ABSTRACT: A type to check for what MaxMind considers a valid credit card token | 
| 45 |  |  |  |  |  |  |  | 
| 46 |  |  |  |  |  |  | __END__ | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | =pod | 
| 49 |  |  |  |  |  |  |  | 
| 50 |  |  |  |  |  |  | =encoding UTF-8 | 
| 51 |  |  |  |  |  |  |  | 
| 52 |  |  |  |  |  |  | =head1 NAME | 
| 53 |  |  |  |  |  |  |  | 
| 54 |  |  |  |  |  |  | WebService::MinFraud::Data::Rx::Type::CCToken - A type to check for what MaxMind considers a valid credit card token | 
| 55 |  |  |  |  |  |  |  | 
| 56 |  |  |  |  |  |  | =head1 VERSION | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | version 1.010000 | 
| 59 |  |  |  |  |  |  |  | 
| 60 |  |  |  |  |  |  | =head1 SUPPORT | 
| 61 |  |  |  |  |  |  |  | 
| 62 |  |  |  |  |  |  | Bugs may be submitted through L<https://github.com/maxmind/minfraud-api-perl/issues>. | 
| 63 |  |  |  |  |  |  |  | 
| 64 |  |  |  |  |  |  | =head1 AUTHOR | 
| 65 |  |  |  |  |  |  |  | 
| 66 |  |  |  |  |  |  | Mateu Hunter <mhunter@maxmind.com> | 
| 67 |  |  |  |  |  |  |  | 
| 68 |  |  |  |  |  |  | =head1 COPYRIGHT AND LICENSE | 
| 69 |  |  |  |  |  |  |  | 
| 70 |  |  |  |  |  |  | This software is copyright (c) 2015 - 2020 by MaxMind, Inc. | 
| 71 |  |  |  |  |  |  |  | 
| 72 |  |  |  |  |  |  | This is free software; you can redistribute it and/or modify it under | 
| 73 |  |  |  |  |  |  | the same terms as the Perl 5 programming language system itself. | 
| 74 |  |  |  |  |  |  |  | 
| 75 |  |  |  |  |  |  | =cut |