CRM-16523 code comments & bypass IPN to call completeOrder
authoreileenmcnaugton <eileen@fuzion.co.nz>
Tue, 4 Aug 2015 05:28:46 +0000 (17:28 +1200)
committereileenmcnaugton <eileen@fuzion.co.nz>
Tue, 4 Aug 2015 05:30:31 +0000 (17:30 +1200)
CRM/Contribute/Form/Task/Status.php
CRM/Core/Payment/BaseIPN.php
api/v3/Contribution.php

index 5d8d4d26a5753f436f56ceec500bcc8df8f3e027..457f85bc05a43628be3d304f464e44965efd9e41 100644 (file)
@@ -288,6 +288,7 @@ AND    co.id IN ( $contribIDs )";
       }
       $input['trxn_date'] = CRM_Utils_Date::processDate($params["trxn_date_{$row['contribution_id']}"]);
 
+      // @todo calling baseIPN like this is a pattern in it's last gasps. Call contribute.completetransaction api.
       $baseIPN->completeTransaction($input, $ids, $objects, $transaction, FALSE);
 
       // reset template values before processing next transactions
index bead2afeb204e6a743b330e3ffb49218789bed17..3cd79301a254b94aa10fcca0426eeb61cc51e6a3 100644 (file)
@@ -39,8 +39,22 @@ class CRM_Core_Payment_BaseIPN {
    */
   protected $_inputParameters = array();
 
+  /**
+   * Only used by AuthorizeNetIPN.
+   *
+   * @deprecated
+   *
+   * @var bool
+   */
   protected $_isRecurring = FALSE;
 
+  /**
+   * Only used by AuthorizeNetIPN.
+   *
+   * @deprecated
+   *
+   * @var bool
+   */
   protected $_isFirstOrLastRecurringPayment = FALSE;
 
   /**
index fd59a8c0f683bee91cf3d5b05327b9d4cb531e42..1b6f1b238405100afe4c9dabb33026a52275dd2f 100644 (file)
@@ -550,10 +550,8 @@ function _ipn_process_transaction(&$params, $contribution, $input, $ids, $firstC
     $input['receipt_from_name'] = CRM_Utils_Array::value('receipt_from_name', $params, $domainFromName);
     $input['receipt_from_email'] = CRM_Utils_Array::value('receipt_from_email', $params, $domainFromEmail);
   }
-  // @todo required for base ipn but problematic as api layer handles this
-  $transaction = new CRM_Core_Transaction();
-  $ipn = new CRM_Core_Payment_BaseIPN();
-  $ipn->completeTransaction($input, $ids, $objects, $transaction, !empty($contribution->contribution_recur_id));
+  CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $objects, $transaction, !empty($contribution->contribution_recur_id), $contribution,
+    FALSE, FALSE);
   return $params;
 }