+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
*/
/**
- * File for the CiviCRM APIv3 Pledge functions
+ * This api exposes CiviCRM Pledge payment.
*
* @package CiviCRM_APIv3
- * @subpackage API_Pledge_Payment
- *
- * @copyright CiviCRM LLC (c) 2004-2014
- * @version $Id: PledgePayment.php
*/
/**
* Add or update a pledge payment.
*
- * Pledge Payment API doesn't actually add a pledge
- * if the request is to 'create' and 'id' is not passed in
- * the oldest pledge with no associated contribution is updated
+ * Pledge Payment API doesn't actually add a pledge.
+ * If the request is to 'create' and 'id' is not passed in
+ * the oldest pledge with no associated contribution is updated.
*
* @todo possibly add ability to add payment if there are less payments than pledge installments
* @todo possibly add ability to recalculate dates if the schedule is changed
//update pledge status
CRM_Pledge_BAO_PledgePayment::updatePledgePaymentStatus($dao->pledge_id);
- return civicrm_api3_create_success($result, $params, 'pledge_payment', 'create', $dao);
+ return civicrm_api3_create_success($result, $params, 'PledgePayment', 'create', $dao);
}
/**
* The metadata is used for setting defaults, documentation & validation.
*
* @param array $params
- * Array or parameters determined by getfields.
+ * Array of parameters determined by getfields.
*/
function _civicrm_api3_pledge_payment_create_spec(&$params) {
$params['pledge_id']['api.required'] = 1;
function civicrm_api3_pledge_payment_delete($params) {
if (CRM_Pledge_BAO_PledgePayment::del($params['id'])) {
- return civicrm_api3_create_success(array('id' => $params['id']), $params, 'pledge_payment', 'delete');
+ return civicrm_api3_create_success(array('id' => $params['id']), $params, 'PledgePayment', 'delete');
}
else {
return civicrm_api3_create_error('Could not delete payment');
* Modifiable list of fields allowed for the PledgePayment.get action.
*/
function civicrm_api3_pledge_payment_get_spec(&$params) {
- $params['option.create_new'] = array('title' => "Create new field rather than update an unpaid payment");
+ $params['option.create_new'] = array(
+ 'title' => "Create New",
+ 'description' => "Create new field rather than update an unpaid payment",
+ 'type' => CRM_Utils_Type::T_BOOLEAN,
+ );
}