WebService::MinFraud::Validator - Validation for the minFraud requests
version 1.009001
use 5.010; use WebService::MinFraud::Validator; my $validator = WebService::MinFraud::Validator->new; my $request = { device => { ip_address => '24.24.24.24' } }; $validator->validate_request($request, 'score'); # takes an optional 'path'
This module defines the request schema for the minFraud API. In addition, it provides a validate_request method that is used to validate any request passed to the score, insights, factors, or chargeback methods.
validate_request
score
insights
factors
chargeback
my $validator = WebService::MinFraud::Validator->new; my $request = { ip => '24.24.24.24' }; $validator->validate_request($request, 'chargeback'); $request = { device => { ip_address => '24.24.24.24' } }; $validator->validate_request($request); # by default will use WebService::MinFraud::Validator::FraudService
This method takes a minFraud request as a HashRef and validates it against the minFraud request schema for the specified API endpoint. A second optional argument can be used to specify the schema to use, socre, insights, factors, chargeback, or fraud_service. If the request HashRef fails validation, an exception is thrown, which is a string containing all of the validation errors.
socre
fraud_service
Bugs may be submitted through https://github.com/maxmind/minfraud-api-perl/issues.
Mateu Hunter <mhunter@maxmind.com>
This software is copyright (c) 2015 - 2019 by MaxMind, Inc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install WebService::MinFraud, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::MinFraud
CPAN shell
perl -MCPAN -e shell install WebService::MinFraud
For more information on module installation, please visit the detailed CPAN module installation guide.