Adamw has uploaded a new change for review.

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

Change subject: set is_recurring and is_refund to false and not null/unset, if 
they are known.
......................................................................

set is_recurring and is_refund to false and not null/unset, if they are known.

Change-Id: I7e5228152f7bece8af65942d885e73b541958af9
---
M sites/all/modules/wmf_civicrm/WmfTransaction.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/10/114910/1

diff --git a/sites/all/modules/wmf_civicrm/WmfTransaction.php 
b/sites/all/modules/wmf_civicrm/WmfTransaction.php
index 3fd5c0f..dfc400c 100644
--- a/sites/all/modules/wmf_civicrm/WmfTransaction.php
+++ b/sites/all/modules/wmf_civicrm/WmfTransaction.php
@@ -58,9 +58,7 @@
         $transaction = new WmfTransaction();
         $transaction->gateway_txn_id = $msg['gateway_txn_id'];
         $transaction->gateway = $msg['gateway'];
-        if ( array_key_exists( 'recurring', $msg ) && $msg['recurring'] ) {
-            $transaction->is_recurring = true;
-        }
+        $transaction->is_recurring = ( array_key_exists( 'recurring', $msg ) 
&& $msg['recurring'] );
         return $transaction;
     }
 
@@ -73,11 +71,13 @@
             throw new WmfException( 'INVALID_MESSAGE', "Missing ID." );
         }
 
+        $transaction->is_refund = false;
         while ( $parts[0] === "RFD" or $parts[0] === "REFUND" ) {
             $transaction->is_refund = true;
             array_shift( $parts );
         }
 
+        $transaction->is_recurring = false;
         while ( $parts[0] === "RECURRING" ) {
             $transaction->is_recurring = true;
             array_shift( $parts );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e5228152f7bece8af65942d885e73b541958af9
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Adamw <[email protected]>

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

Reply via email to