3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * This api exposes CiviCRM soft credits.
15 * @package CiviCRM_APIv3
19 * Create or Update a Soft Credit.
21 * @param array $params
22 * Array per getfields metadata.
27 function civicrm_api3_contribution_soft_create($params) {
28 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'ContributionSoft');
32 * Adjust Metadata for Create action.
34 * The metadata is used for setting defaults, documentation & validation.
36 * @param array $params
37 * Array of parameters determined by getfields.
39 function _civicrm_api3_contribution_soft_create_spec(&$params) {
40 $params['contribution_id']['api.required'] = 1;
41 $params['contact_id']['api.required'] = 1;
42 $params['amount']['api.required'] = 1;
46 * Deletes an existing Soft Credit.
48 * @param array $params
51 * Api formatted result.
53 * @throws API_Exception
55 function civicrm_api3_contribution_soft_delete($params) {
56 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
60 * Retrieve one or more Soft Credits.
62 * @param array $params
63 * Array per getfields metadata.
68 function civicrm_api3_contribution_soft_get($params) {
69 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params);