Ejegg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/319957

Change subject: More logging around fraud filters
......................................................................

More logging around fraud filters

Log reasons for skipping the filter runs. Should help us figure out
why they are so seldom run in the orphan rectifier.

Bug: T145848
Change-Id: Ib0955a03261755222b4cebd05b2d1fbdf8a9fda4
---
M globalcollect_gateway/globalcollect.adapter.php
M globalcollect_gateway/orphan.adapter.php
2 files changed, 13 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/57/319957/1

diff --git a/globalcollect_gateway/globalcollect.adapter.php 
b/globalcollect_gateway/globalcollect.adapter.php
index 1550afa..e54f98c 100644
--- a/globalcollect_gateway/globalcollect.adapter.php
+++ b/globalcollect_gateway/globalcollect.adapter.php
@@ -1659,11 +1659,18 @@
                static $checked = array();
 
                $oid = $this->getData_Unstaged_Escaped('order_id');
-               if ( $this->getData_Unstaged_Escaped( 'payment_method' ) === 
'cc'
-                       && empty( $checked[$oid] )
-               ) {
+               $method = $this->getData_Unstaged_Escaped( 'payment_method' );
+               if ( $method === 'cc' && empty( $checked[$oid] ) ) {
                        $this->runAntifraudFilters();
                        $checked[$oid] = true;
+               } else {
+                       $message = 'Skipping fraud filters: ';
+                       if ( !empty( $checked[$oid] ) ) {
+                               $message .= "already checked order id '$oid'";
+                       } else {
+                               $message .= "payment method is '$method'";
+                       }
+                       $this->logger->info( $message );
                }
        }
 
diff --git a/globalcollect_gateway/orphan.adapter.php 
b/globalcollect_gateway/orphan.adapter.php
index fbc84b4..296b0d3 100644
--- a/globalcollect_gateway/orphan.adapter.php
+++ b/globalcollect_gateway/orphan.adapter.php
@@ -201,7 +201,10 @@
 
                // Don't bother unless we expect to be able to finalize this 
payment.
                if ( $action === FinalStatus::PENDING_POKE ) {
+                       $this->logger->info( 'Final status is PENDING_POKE, 
running fraud filters' );
                        parent::post_process_get_orderstatus();
+               } else {
+                       $this->logger->info( "Skipping fraud filters for final 
status $action." );
                }
        }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/319957
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib0955a03261755222b4cebd05b2d1fbdf8a9fda4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to