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 participant payments.
15 * @package CiviCRM_APIv3
19 * Create a Event Participant Payment.
21 * This API is used for creating a Participant Payment of Event.
22 * Required parameters: participant_id, contribution_id.
24 * @param array $params
25 * An associative array of name/value property values of civicrm_participant_payment.
29 function civicrm_api3_participant_payment_create($params) {
30 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'ParticipantPayment');
34 * Adjust Metadata for Create action.
36 * The metadata is used for setting defaults, documentation & validation.
38 * @param array $params
39 * Array of parameters determined by getfields.
41 function _civicrm_api3_participant_payment_create_spec(&$params) {
42 $params['participant_id']['api.required'] = 1;
43 $params['contribution_id']['api.required'] = 1;
47 * Deletes an existing Participant Payment.
49 * @param array $params
54 function civicrm_api3_participant_payment_delete($params) {
55 $participant = new CRM_Event_BAO_ParticipantPayment();
56 return $participant->deleteParticipantPayment($params) ?
civicrm_api3_create_success() : civicrm_api3_create_error('Error while deleting participantPayment');
60 * Retrieve one or more participant payment records.
62 * @param array $params
66 * array of properties, if error an array with an error id and error message
68 function civicrm_api3_participant_payment_get($params) {
69 return _civicrm_api3_basic_get('CRM_Event_DAO_ParticipantPayment', $params);