jenkins-bot has submitted this change and it was merged.

Change subject: Logging changes for DonationInterface
......................................................................


Logging changes for DonationInterface

Demoting one line of total noise, and adding a bunch of lines for
debugging a session thing happing very occasionally in prod.

Change-Id: Ia669b69f3956920ccaa4fe31b4fa15f96e17e8c9
---
M gateway_common/DonationData.php
M gateway_common/gateway.adapter.php
M globalcollect_gateway/globalcollect_resultswitcher.body.php
3 files changed, 10 insertions(+), 2 deletions(-)

Approvals:
  Ejegg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/gateway_common/DonationData.php b/gateway_common/DonationData.php
index d71819a..3e6a143 100644
--- a/gateway_common/DonationData.php
+++ b/gateway_common/DonationData.php
@@ -797,7 +797,7 @@
                );
 
                $recurring = ($this->getVal( 'recurring' ) ? 'true' : 'false');
-               $this->log( "Payment method is {$this->getVal( 'payment_method' 
)}, recurring = {$recurring}, utm_source = {$payment_method_family}", LOG_INFO 
);
+               $this->log( __FUNCTION__ . ": Payment method is {$this->getVal( 
'payment_method' )}, recurring = {$recurring}, utm_source = 
{$payment_method_family}", LOG_DEBUG );
 
                // split the utm_source into its parts for easier manipulation
                $source_parts = explode( ".", $utm_source );
diff --git a/gateway_common/gateway.adapter.php 
b/gateway_common/gateway.adapter.php
index 7843b8c..b0214fc 100644
--- a/gateway_common/gateway.adapter.php
+++ b/gateway_common/gateway.adapter.php
@@ -2967,6 +2967,7 @@
         * This will be used internally every time we call do_transaction.
         */
        public function session_addDonorData() {
+               $this->log( __FUNCTION__ . ': Refreshing all donor data', 
LOG_INFO );
                self::session_ensure();
                $_SESSION['Donor'] = array ( );
                $donordata = DonationData::getStompMessageFields();
@@ -3021,6 +3022,7 @@
                }
 
                if ( $reset ) {
+                       $this->log( __FUNCTION__ . ': Unsetting session donor 
data', LOG_INFO );
                        $this->session_unsetDonorData();
                        //leave the payment forms and antifraud data alone.
                        //but, under no circumstances should the gateway edit
@@ -3031,10 +3033,15 @@
                                'numAttempt',
                                'order_status', //for post-payment activities
                        );
+                       $msg = '';
                        foreach ( $_SESSION as $key => $value ) {
                                if ( !in_array( $key, $preserve_main ) ) {
+                                       $msg .= "$key, "; //always one extra 
comma; Don't care.
                                        unset( $_SESSION[$key] );
                                }
+                       }
+                       if ( $msg != '' ) {
+                               $this->log( __FUNCTION__ . ": Unset the 
following session keys: $msg", LOG_INFO );
                        }
                } else {
                        //I'm sure we could put more here...
@@ -3044,6 +3051,7 @@
                        foreach ( $soft_reset as $reset_me ) {
                                unset( $_SESSION['Donor'][$reset_me] );
                        }
+                       $this->log( __FUNCTION__ . ': Soft reset, order_id 
only', LOG_INFO );
                }
        }
 
diff --git a/globalcollect_gateway/globalcollect_resultswitcher.body.php 
b/globalcollect_gateway/globalcollect_resultswitcher.body.php
index eca5b13..f4e8cbf 100644
--- a/globalcollect_gateway/globalcollect_resultswitcher.body.php
+++ b/globalcollect_gateway/globalcollect_resultswitcher.body.php
@@ -67,7 +67,7 @@
 
                if ( is_null( $session_oid ) || ( ($this->qs_oid !== 
$session_oid) && strpos( $_GET['REF'], ( string ) $session_oid ) === false ) ) {
                        $forbidden = true;
-                       $f_message = 'Requested order id not present in the 
session';
+                       $f_message = "Requested order id not present in the 
session. (session_oid = '$session_oid')";
 
                        if ( !$_SESSION ) {
                                $this->adapter->log( "Resultswitcher: 
{$this->qs_oid} Is popped out, but still has no session data.", LOG_ERR );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia669b69f3956920ccaa4fe31b4fa15f96e17e8c9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Katie Horn <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: Ssmith <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to