| 1 | package Business::MaxMind::CreditCardFraudDetection; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | 1 | ▶ | use Digest::MD5; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use LWP::UserAgent; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 1 | ▶ | use base 'Business::MaxMind::HTTPBase'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | 1 | our $VERSION = '1.60'; | |||||||||||
| 10 | |||||||||||||
| 11 | # input fields | ||||||||||||
| 12 | my @allowed_fields | ||||||||||||
| 13 | 1 | = qw/i city region postal country domain bin binName binPhone | |||||||||||
| 14 | custPhone emailMD5 usernameMD5 passwordMD5 shipAddr shipCity | ||||||||||||
| 15 | shipRegion shipPostal shipCountry txnID sessionID user_agent | ||||||||||||
| 16 | accept_language order_amount order_currency shopID avs_result | ||||||||||||
| 17 | cvv_result txn_type license_key requested_type forwardedIP/; | ||||||||||||
| 18 | |||||||||||||
| 19 | 2 | ▶ | sub _init { | ||||||||||
|
Subroutine
_init: called CC=2 SCAR=7.0
| |||||||||||||
| 20 | 2 | my $self = shift; | |||||||||||
| 21 | 2 | $self->{url} = 'app/ccv2r'; | |||||||||||
| 22 | 2 | $self->{check_field} = 'countryMatch'; | |||||||||||
| 23 | 2 | ▶ | $self->{timeout} ||= 10 | ||||||||||
|
Condition50%1/2
$self->{"timeout"} ||= 10
MC/DC0%0/1
$self->{"timeout"} ||= 10
$self->{"timeout"}
Truth table50%1/2
A
A= $self->{"timeout"}
| |||||||||||||
| 24 | ; # provide a default value of 10 seconds for timeout if not set by user | ||||||||||||
| 25 | 2 | %{ $self->{allowed_fields} } = map { $_ => 1 } @allowed_fields; | |||||||||||
| 26 | } | ||||||||||||
| 27 | |||||||||||||
| 28 | 0 | ▶ | sub filter_field { | ||||||||||
|
Subroutine
filter_field: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||
| 29 | 0 | my ( $self, $name, $value ) = @_; | |||||||||||
| 30 | |||||||||||||
| 31 | 0 | ▶ | if ( $name eq 'emailMD5' ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 32 | 0 | ▶ | if ( $value =~ m!\@! ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 33 | 0 | return Digest::MD5::md5_hex( lc($value) ); | |||||||||||
| 34 | } | ||||||||||||
| 35 | } | ||||||||||||
| 36 | |||||||||||||
| 37 | 0 | ▶ | if ( $name =~ m!(username|password)MD5$! ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 38 | 0 | ▶ | if ( length($value) != 32 ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 39 | 0 | return Digest::MD5::md5_hex( lc($value) ); | |||||||||||
| 40 | } | ||||||||||||
| 41 | } | ||||||||||||
| 42 | |||||||||||||
| 43 | 0 | return $value; | |||||||||||
| 44 | } | ||||||||||||
| 45 | |||||||||||||
| 46 | 1 | 1; | |||||||||||
| 47 | |||||||||||||
| 48 | # ABSTRACT: Access MaxMind minFraud services | ||||||||||||
| 49 | |||||||||||||
| 50 | __END__ | ||||||||||||