CRM-21052 - Activity.create API - Abide by setting `civicaseActivityRevisions`
[civicrm-core.git] / api / v3 / FinancialTrxn.php
index 6a5c3f1dd52215a81a1887b9e66465b7c78f00f8..12058a157f5d14e0d81e1d6c9d2d45b0cc6c5ccf 100644 (file)
  * @return array
  */
 function civicrm_api3_financial_trxn_create($params) {
-  return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+  if (empty($params['id']) && empty($params['contribution_id']) && empty($params['entity_id'])) {
+    throw new API_Exception("Mandatory key(s) missing from params array: both contribution_id and entity_id are missing");
+  }
+
+  return _civicrm_api3_basic_create('CRM_Core_BAO_FinancialTrxn', $params);
 }
 
 /**