From 59cdadfc1d91511f0845f0b1e4ed4c39794a96e8 Mon Sep 17 00:00:00 2001 From: eileenmcnaugton Date: Tue, 4 Aug 2015 17:28:46 +1200 Subject: [PATCH] CRM-16523 code comments & bypass IPN to call completeOrder --- CRM/Contribute/Form/Task/Status.php | 1 + CRM/Core/Payment/BaseIPN.php | 14 ++++++++++++++ api/v3/Contribution.php | 6 ++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CRM/Contribute/Form/Task/Status.php b/CRM/Contribute/Form/Task/Status.php index 5d8d4d26a5..457f85bc05 100644 --- a/CRM/Contribute/Form/Task/Status.php +++ b/CRM/Contribute/Form/Task/Status.php @@ -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 diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index bead2afeb2..3cd79301a2 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -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; /** diff --git a/api/v3/Contribution.php b/api/v3/Contribution.php index fd59a8c0f6..1b6f1b2384 100644 --- a/api/v3/Contribution.php +++ b/api/v3/Contribution.php @@ -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; } -- 2.25.1