Merge pull request #6500 from LevityNL/master
[civicrm-core.git] / api / v3 / Contribution.php
index 1f393bbaae800ff3673e3b1374b8b5ec57f2d8d6..ee3d251e2b1d9896550212b7c36aa14ad6a6d59f 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
@@ -427,6 +427,9 @@ function civicrm_api3_contribution_completetransaction(&$params) {
     throw new API_Exception(ts('Contribution already completed'), 'contribution_completed');
   }
   $input['trxn_id'] = !empty($params['trxn_id']) ? $params['trxn_id'] : $contribution->trxn_id;
+  if (!empty($params['fee_amount'])) {
+    $input['fee_amount'] = $params['fee_amount'];
+  }
   $params = _ipn_process_transaction($params, $contribution, $input, $ids);
 
 }
@@ -460,12 +463,16 @@ function _civicrm_api3_contribution_completetransaction_spec(&$params) {
     'description' => '. If not provided this will default to domain mail or contribution page',
     'type' => CRM_Utils_Type::T_STRING,
   );
-
   $params['payment_processor_id'] = array(
     'title' => 'Payment processor ID',
-    'description' => 'Providing this is strongly recommended, as not possible to calculate it accurately always',
+    'description' => 'Providing this is strongly recommended, as not possible to calculate it accurately always',
     'type' => CRM_Utils_Type::T_INT,
   );
+  $params['fee_amount'] = array(
+    'title' => 'Fee charged on transaction',
+    'description' => 'If a fee has been charged then the amount',
+    'type' => CRM_Utils_Type::T_FLOAT,
+  );
 }
 
 /**