CRM-16923 accept payment_processor_id as a completetransaction param
authoreileenmcnaughton <eileen@fuzion.co.nz>
Wed, 29 Jul 2015 08:05:42 +0000 (08:05 +0000)
committereileenmcnaughton <eileen@fuzion.co.nz>
Wed, 29 Jul 2015 08:05:42 +0000 (08:05 +0000)
api/v3/Contribution.php

index 121a1d82e25585357c34feb6a9de4c584f158fee..20cc1aedc760b50e26a002be8fcd2bfd5c0b001e 100644 (file)
@@ -410,6 +410,9 @@ function _civicrm_api3_contribution_sendconfirmation_spec(&$params) {
 function civicrm_api3_contribution_completetransaction(&$params) {
 
   $input = $ids = array();
+  if (isset($params['payment_processor_id'])) {
+    $input['payment_processor_id'] = $params['payment_processor_id'];
+  }
   $contribution = new CRM_Contribute_BAO_Contribution();
   $contribution->id = $params['id'];
   $contribution->find(TRUE);
@@ -460,6 +463,12 @@ 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',
+    'type' => CRM_Utils_Type::T_INT,
+  );
 }
 
 /**