X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FraudDetect.pm;h=3624f5a913f1dc6be839f00ebbf7339f9f6f5eae;hb=d1ffb1dddfef66b75320f92929616df6a784d821;hp=834e135c53aa7d4989e07e182071e69b6f7d4415;hpb=e4baa8fbc931498d1cf7cc3bdcf32f8dbea21186;p=Business-OnlinePayment.git diff --git a/FraudDetect.pm b/FraudDetect.pm index 834e135..3624f5a 100644 --- a/FraudDetect.pm +++ b/FraudDetect.pm @@ -8,3 +8,78 @@ $VERSION = '0.01'; @ISA = qw / Business::OnlinePayment /; 1; + +=pod + +=head1 NAME + +Business::FraudDetect - A cohort to Business::OnlinePayment + +=head1 SYNOPSIS + + my %processor_info = ( risk_Management => 'preCharge', + maximum_risk => 500, + risk_management_params => { + preCharge_id => '1000000000000001', + preCharge_security1 => 'abcdef0123', + preCharge_security2 => '3210fedcba', + }, + ) + my $transaction = new Business::OnlinePayment($processor, %processor_info); + $transaction->content( + type => 'Visa', + amount => '49.95', + cardnumber => '1234123412341238', + expiration => '0100', + name => 'John Q Doe', + ); + $transaction->submit(); + + if($transaction->is_success()) { + print "Card processed successfully: ".$transaction->authorization()."\n"; + } else { + print "Card was rejected: ".$transaction->error_message()."\n"; + } + +=head1 DESCRIPTION + +This is a module that adds functionality to Business::OnlinePayment. See L. + +The user instantiates a Business::OnlinePayment object per usual, adding in three processor directives + +=over 4 + +=item * risk_Management + +Which Fraud Detection module to use. + +=item * maximum_risk + +FraudDetection drivers are expected to return a numeric "risk" factor, this parameter allows you to set the threshold to reject the transaction based on that risk. Higher numbers are "riskier" transactions. + +=item * risk_management_params + +Driver-specific parameters. Extant module uses this to pass in identity/authorization credentials. + +=back + +The $tx->submit() method is overridden to interpose a FraudDetection phase. A subordinate object is created using the same content as the parent OnlinePayment object, and a I action is run against that subordinate object. If the resulting fraud score is less than or equal to the maximum_risk parameter, the parent transaction will be allowed to proceed. Otherwise, a failure state will exist with a suitable error message. + +=head1 METHODS + +This module provides no new methods. It does, however override the +submit method to interpose an additional Fraud Detection phase. + +=head1 AUTHORS + +Lawrence Statton + +=head1 DISCLAIMER + +THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +=head1 SEE ALSO + +http://420.am/business-onlinepayment + +=cut