Ejegg has submitted this change and it was merged.

Change subject: Logging; whitespace
......................................................................


Logging; whitespace

Change-Id: I5f3b1ef0c9356134f37b4bb5f063495ecfbd9dd2
---
M sites/all/modules/queue2civicrm/recurring/recurring.module
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
2 files changed, 11 insertions(+), 3 deletions(-)

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



diff --git a/sites/all/modules/queue2civicrm/recurring/recurring.module 
b/sites/all/modules/queue2civicrm/recurring/recurring.module
index fe64484..42806a3 100644
--- a/sites/all/modules/queue2civicrm/recurring/recurring.module
+++ b/sites/all/modules/queue2civicrm/recurring/recurring.module
@@ -493,7 +493,7 @@
 
   //Seeing as we're in the recurring module...
   $msg[ 'recurring' ] = true;
-  
+
   $msg = wmf_civicrm_normalize_msg( $msg );
   return $msg;
 }
@@ -516,7 +516,6 @@
 
   $timestamp = ( !isset( $msg[ 'payment_date' ] ) || !strlen( $msg[ 
'payment_date' ] )) ? strtotime( "now" ) : strtotime( $msg[ 'payment_date' ] );
 
-  
   // the subscription id
   $msg_normalized[ 'subscr_id' ] = $msg[ 'subscr_id' ];
   $msg_normalized[ 'txn_type' ] = $msg[ 'txn_type' ];
diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 95c781b..58f2dc0 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -62,6 +62,7 @@
 /**
  * Determines the settlement currency for a given donation.
  * Argument is a queue message or a civicrm contribution array.
+ * TODO: implement hook to determine our actual settlement currency.
  */
 function wmf_civicrm_get_settlement_currency($transaction)
 {
@@ -616,6 +617,8 @@
         and ( empty( $msg['original_gross'] ) or empty( 
$msg['original_currency'] ) )
     ) {
         // just... don't
+        watchdog( 'wmf_civicrm', 'Not freaking out about non-monetary 
message.',
+            NULL, WATCHDOG_INFO );
         return $msg;
     }
 
@@ -637,6 +640,9 @@
 
     $settlement_currency = wmf_civicrm_get_settlement_currency($msg);
     if ( $msg['currency'] !== $settlement_currency ) {
+        watchdog( 'wmf_civicrm', 'Converting to settlement currency: %old -> 
%new',
+            array( '%old' => $msg['currency'], '%new' => $settlement_currency 
),
+            WATCHDOG_INFO );
         try {
             $settlement_convert = 
exchange_rate_convert($msg['original_currency'], 1, $msg['date']) / 
exchange_rate_convert($settlement_currency, 1, $msg['date']);
         }
@@ -1050,7 +1056,10 @@
     //if they don't exist (even if they're blank).
     // FIXME: don't use defaults.  Access msg properties using a functional 
interface.
     $defaults = array(
-        'date' => time(), //defaulting to now. @fixme: if you can think of a 
better thing to do in the name of historical exchange rates.
+        // FIXME: Default to now. If you can think of a better thing to do in
+        // the name of historical exchange rates.  Searching ts and
+        // source_enqueued_time is a good start.
+        'date' => time(),
         'first_name' => '',
         'middle_name' => '',
         'last_name' => '',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5f3b1ef0c9356134f37b4bb5f063495ecfbd9dd2
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Awight <awi...@wikimedia.org>
Gerrit-Reviewer: Awight <awi...@wikimedia.org>
Gerrit-Reviewer: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: Katie Horn <kh...@wikimedia.org>
Gerrit-Reviewer: Mwalker <mwal...@wikimedia.org>
Gerrit-Reviewer: Ssmith <ssm...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to