added POD
[Business-OnlinePayment.git] / FraudDetect.pm
1 package Business::FraudDetect;
2
3
4
5 use vars qw / $VERSION @ISA /;
6
7 $VERSION = '0.01';
8 @ISA = qw / Business::OnlinePayment /;
9
10 1;
11
12 =pod
13
14 =head1 NAME
15
16 Business::FraudDetect - A cohort to Business::OnlinePayment
17
18 =head1 SYNOPSIS
19
20   my %processor_info = ( risk_Management => 'preCharge',
21                          maximum_risk => 500,
22                          risk_management_params => {
23                            preCharge_id => '1000000000000001',
24                            preCharge_security1 => 'abcdef0123',
25                            preCharge_security2 => '3210fedcba',
26                          },
27                         )
28   my $transaction = new Business::OnlinePayment($processor, %processor_info);
29   $transaction->content(
30                         type       => 'Visa',
31                         amount     => '49.95',
32                         cardnumber => '1234123412341238',
33                         expiration => '0100',
34                         name       => 'John Q Doe',
35                        );
36   $transaction->submit();
37
38   if($transaction->is_success()) {
39     print "Card processed successfully: ".$transaction->authorization()."\n";
40   } else {
41     print "Card was rejected: ".$transaction->error_message()."\n";
42   }
43
44 =head1 DESCRIPTION
45
46 This is a module that adds functionality to Business::OnlinePayment.  See L<Business::OnlinePayment>.
47
48 The user instantiates a Business::OnlinePayment object per usual, adding in three processor directives
49
50 =over 4
51
52 =item *  risk_Management
53
54 Which Fraud Detection module to use.
55
56 =item *  maximum_risk
57
58 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.
59
60 =item * risk_management_params
61
62 Driver-specific parameters.  Extant module uses this to pass in identity/authorization credentials.
63
64 =back
65
66 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<Fraud Detect> 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.
67
68 =head1 METHODS
69
70 This module provides no new methods.  It does, however override the
71 submit method to interpose an additional Fraud Detection phase. 
72
73 =head1 AUTHORS
74
75 Lawrence Statton <lawrence@cluon.com>
76
77 =head1 DISCLAIMER
78
79 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.
80
81 =head1 SEE ALSO
82
83 http://420.am/business-onlinepayment
84
85 =cut