/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
'amount' => $params['total_amount']));
}
- if (CRM_Utils_Array::value('id', $params) && CRM_Utils_Array::value('contribution_status_id', $params)) {
+ if (!empty($params['id']) && !empty($params['contribution_status_id'])) {
$error = array();
//throw error for invalid status change such as setting completed back to pending
//@todo this sort of validation belongs in the BAO not the API - if it is not an OK
$params['contact_id']['api.required'] = 1;
$params['total_amount']['api.required'] = 1;
$params['payment_instrument_id']['api.aliases'] = array('payment_instrument');
+ $params['receive_date']['api.default'] = 'now';
$params['payment_processor'] = array(
'name' => 'payment_processor',
'title' => 'Payment Processor ID',
'api.default' => 0,
'description' => 'Do not add line items by default (if you wish to add your own)',
);
+ $params['batch_id'] = array(
+ 'title' => 'Batch',
+ 'type' => 1,
+ 'description' => 'Batch which relevant transactions should be added to',
+ );
}
/**
*/
function civicrm_api3_contribution_delete($params) {
- $contributionID = CRM_Utils_Array::value('contribution_id', $params) ? $params['contribution_id'] : $params['id'];
+ $contributionID = !empty($params['contribution_id']) ? $params['contribution_id'] : $params['id'];
if (CRM_Contribute_BAO_Contribution::deleteContribution($contributionID)) {
return civicrm_api3_create_success(array($contributionID => 1));
}
}
/**
- * Adjust Metadata for Create action
+ * Adjust Metadata for sendconfirmation action
*
* The metadata is used for setting defaults, documentation & validation
* @param array $params array or parameters determined by getfields
);
$params['receipt_from_email'] = array(
'api.required' =>1,
- 'title' => 'From Email (required until someone provides a patch :-)',
-
+ 'title' => 'From Email address (string) required until someone provides a patch :-)',
+ );
+ $params['receipt_from_name'] = array(
+ 'title' => 'From Name (string)',
+ );
+ $params['cc_receipt'] = array(
+ 'title' => 'CC Email address (string)',
+ );
+ $params['bcc_receipt'] = array(
+ 'title' => 'BCC Email address (string)',
+ );
+ $params['receipt_text'] = array(
+ 'title' => 'Message (string)',
);
}
$ipn = new CRM_Core_Payment_BaseIPN();
$ipn->completeTransaction($input, $ids, $objects, $transaction);
}
- catch(Exception$e) {
+ catch(Exception $e) {
throw new API_Exception('failed to load related objects' . $e->getMessage() . "\n" . $e->getTraceAsString());
}
}