CRM-15286 - Set correct payment instrument in api contribution.transact
authorColeman Watts <coleman@civicrm.org>
Fri, 12 Sep 2014 01:44:16 +0000 (21:44 -0400)
committerColeman Watts <coleman@civicrm.org>
Fri, 12 Sep 2014 01:44:16 +0000 (21:44 -0400)
api/v3/Contribution.php

index cd9f8f79d317a59fce43b5878749053889b40660..1385765a32f558163db74ed1d207fc1fb6d55b3a 100644 (file)
@@ -295,7 +295,7 @@ function civicrm_api3_contribution_transact($params) {
       return CRM_Core_Error::createApiError($last_error['message']);
     }
   }
-
+  $params['payment_instrument_id'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', $paymentProcessor['payment_processor_type_id'], 'payment_type') == 1 ? 'Credit Card' : 'Debit Card';
   return civicrm_api('contribution', 'create', $params);
 }
 /**