Enable retrieval of fraud transaction score and transaction ID, B:OP and B:FD:preChar...
[Business-OnlinePayment.git] / OnlinePayment.pm
index 632c822..da75db4 100644 (file)
@@ -13,20 +13,22 @@ $VERSION = eval $VERSION; # modperlstyle: convert the string into a number
 my %Presubmit_Added = ();
 
 my %fields = (
-    authorization    => undef,
-    error_message    => undef,
-    failure_status   => undef,
-    fraud_detect     => undef,
-    is_success       => undef,
-    maximum_risk     => undef,
-    path             => undef,
-    port             => undef,
-    require_avs      => undef,
-    result_code      => undef,
-    server           => undef,
-    server_response  => undef,
-    test_transaction => undef,
-    transaction_type => undef,
+    authorization        => undef,
+    error_message        => undef,
+    failure_status       => undef,
+    fraud_detect         => undef,
+    is_success           => undef,
+    maximum_risk         => undef,
+    path                 => undef,
+    port                 => undef,
+    require_avs          => undef,
+    result_code          => undef,
+    server               => undef,
+    server_response      => undef,
+    test_transaction     => undef,
+    transaction_type     => undef,
+    fraud_score          => undef,
+    fraud_transaction_id => undef,
 );
 
 sub new {
@@ -78,6 +80,8 @@ sub _risk_detect {
     $risk_transaction->content( %parent_content );
     $risk_transaction->submit();
     if ($risk_transaction->is_success()) {
+         $self->fraud_score( $risk_transaction->fraud_score );
+         $self->fraud_transaction_id( $risk_transaction->fraud_transaction_id );
        if ( $risk_transaction->fraud_score <= $self->maximum_fraud_score()) {
            return 1;
        } else {
@@ -527,6 +531,14 @@ RISK).
 Retrieve or change the processor submission path (CHANGE AT YOUR OWN
 RISK).
 
+=head2 fraud_score();
+
+Retrieve or change the fraud score from any Business::FraudDetect plugin
+
+=head2 fraud_transaction_id();
+
+Retrieve or change the transaction id from any Business::FraudDetect plugin
+
 =head1 AUTHORS
 
 Jason Kohles, email@jasonkohles.com