* @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);
}
/**