From: Eileen McNaughton Date: Thu, 3 Apr 2014 10:39:21 +0000 (+1300) Subject: CRM-14420 - api contribution.completetransaction should accept 'trxn_id' as a param X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=88ef1d88526770fa60f1a970a449eb05abe74697;p=civicrm-core.git CRM-14420 - api contribution.completetransaction should accept 'trxn_id' as a param --- diff --git a/api/v3/Contribution.php b/api/v3/Contribution.php index 19047e9c3b..cd9f8f79d3 100644 --- a/api/v3/Contribution.php +++ b/api/v3/Contribution.php @@ -380,7 +380,7 @@ function civicrm_api3_contribution_completetransaction(&$params) { $objects['contribution'] = &$contribution; $input['component'] = $contribution->_component; $input['is_test'] = $contribution->is_test; - $input['trxn_id']= $contribution->trxn_id; + $input['trxn_id']= !empty($params['trxn_id']) ? $params['trxn_id'] : $contribution->trxn_id; $input['amount'] = $contribution->total_amount; if(isset($params['is_email_receipt'])){ $input['is_email_receipt'] = $params['is_email_receipt']; @@ -396,5 +396,17 @@ function civicrm_api3_contribution_completetransaction(&$params) { } function _civicrm_api3_contribution_completetransaction(&$params) { - + $params['id'] = array( + 'title' => 'Contribution ID', + 'type' => CRM_Utils_Type::T_INT, + 'api.required' => TRUE, + ); + $params['trxn_id'] = array( + 'title' => 'Transaction ID', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['is_email_receipt'] = array( + 'title' => 'Send email Receipt?', + 'type' => CRM_Utils_Type::T_BOOLEAN, + ); }