/*
* construct method
*/
+ /**
+ * class constructor
+ *
+ * @access public
+ * @return \CRM_Contribute_DAO_Contribution
+ */
+ /**
+ *
+ */
function __construct() {
parent::__construct();
}
return self::$_importableFields;
}
+ /**
+ * @return array
+ */
static function &exportableFields() {
if (!self::$_exportableFields) {
if (!self::$_exportableFields) {
return self::$_exportableFields;
}
+ /**
+ * @param null $status
+ * @param null $startDate
+ * @param null $endDate
+ *
+ * @return array|null
+ */
static function getTotalAmountAndCount($status = NULL, $startDate = NULL, $endDate = NULL) {
$where = array();
switch ($status) {
return $extraFields;
}
+ /**
+ * @param $pageID
+ *
+ * @return array
+ */
static function getCurrentandGoalAmount($pageID) {
$query = "
SELECT p.goal_amount as goal, sum( c.total_amount ) as total
return CRM_Core_DAO::singleValueQuery($query, CRM_Core_DAO::$_nullArray);
}
+ /**
+ * @param $contactID
+ *
+ * @return array
+ */
static function annual($contactID) {
if (is_array($contactID)) {
$contactIDs = implode(',', $contactID);
return $componentDetails;
}
+ /**
+ * @param $contactId
+ * @param bool $includeSoftCredit
+ *
+ * @return null|string
+ */
static function contributionCount($contactId, $includeSoftCredit = TRUE) {
if (!$contactId) {
return 0;
* @param boolean $loadAll - load all related objects - even where id not passed in? (allows API to call this)
* Note that the unit test for the BaseIPN class tests this function
*/
+ /**
+ * @param $input
+ * @param $ids
+ * @param bool $required
+ * @param bool $loadAll
+ *
+ * @return bool
+ * @throws Exception
+ */
function loadRelatedObjects(&$input, &$ids, $required = FALSE, $loadAll = false) {
if($loadAll){
$ids = array_merge($this->getComponentDetails($this->id),$ids);
* function doing emails / pdfs with it
* @return array $messageArray - messages
*/
+ /**
+ * @param $input
+ * @param $ids
+ * @param $values
+ * @param bool $recur
+ * @param bool $returnMessageText
+ *
+ * @throws Exception
+ */
function composeMessageArray(&$input, &$ids, &$values, $recur = FALSE, $returnMessageText = TRUE) {
if (empty($this->_relatedObjects)) {
$this->loadRelatedObjects($input, $ids);
*
* NB don't add direct calls to the function as we intend to change the signature
*/
+ /**
+ * @param $input
+ * @param $values
+ * @param array $ids
+ *
+ * @return mixed
+ */
function _gatherMessageValues($input, &$values, $ids = array()) {
// set display address of contributor
if ($this->address_id) {
* @param array $trxnData : to take user provided input of transaction details.
* @param string $paymentType 'owed' for purpose of recording partial payments, 'refund' for purpose of recording refund payments
*/
+ /**
+ * @param $contributionId
+ * @param $trxnsData
+ * @param string $paymentType
+ * @param null $participantId
+ *
+ * @return null|object
+ */
static function recordAdditionalPayment($contributionId, $trxnsData, $paymentType = 'owed', $participantId = NULL) {
$statusId = CRM_Core_OptionGroup::getValue('contribution_status', 'Completed', 'name');
$getInfoOf['id'] = $contributionId;
return $financialTrxn;
}
+ /**
+ * @param $entityObj
+ * @param $trxnObj
+ * @param $activityType
+ * @param $component
+ * @param $contributionId
+ *
+ * @throws CRM_Core_Exception
+ */
static function addActivityForPayment($entityObj, $trxnObj, $activityType, $component, $contributionId) {
if ($component == 'event') {
$date = CRM_Utils_Date::isoToMysql($trxnObj->trxn_date);
CRM_Activity_BAO_Activity::create($activityParams);
}
+ /**
+ * @param $id
+ * @param $component
+ * @param bool $getTrxnInfo
+ * @param bool $usingLineTotal
+ *
+ * @return mixed
+ */
static function getPaymentInfo($id, $component, $getTrxnInfo = FALSE, $usingLineTotal = FALSE) {
if ($component == 'event') {
$entity = 'participant';
return $params;
}
+ /**
+ * @param $params
+ * @param $contactID
+ * @param $mail
+ */
static function createCMSUser(&$params, $contactID, $mail) {
// lets ensure we only create one CMS user
static $created = FALSE;
}
}
+ /**
+ * @param $params
+ * @param string $type
+ *
+ * @return bool
+ */
static function _fillCommonParams(&$params, $type = 'paypal') {
if (array_key_exists('transaction', $params)) {
$transaction = &$params['transaction'];
return TRUE;
}
+ /**
+ * @param $apiParams
+ * @param $mapper
+ * @param string $type
+ * @param bool $category
+ *
+ * @return array
+ */
static function formatAPIParams($apiParams, $mapper, $type = 'paypal', $category = TRUE) {
$type = strtolower($type);
}
}
+ /**
+ * @param $params
+ *
+ * @return bool
+ */
static function processAPIContribution($params) {
if (empty($params) || array_key_exists('error', $params)) {
return FALSE;
return TRUE;
}
+ /**
+ * @param $contactID
+ *
+ * @return mixed
+ */
static function getFirstLastDetails($contactID) {
static $_cache;
return CRM_Core_DAO::setFieldValue('CRM_Contribute_DAO_ContributionPage', $id, 'is_active', $is_active);
}
+ /**
+ * @param $id
+ * @param $values
+ */
static function setValues($id, &$values) {
$params = array(
'id' => $id,
* Construct the message to be sent by the send function
*
*/
+ /**
+ * @param $tplParams
+ * @param $contactID
+ * @param $isTest
+ *
+ * @return array
+ */
function composeMessage($tplParams, $contactID, $isTest) {
$sendTemplateParams = array(
'groupName' => $tplParams['membershipID'] ? 'msg_tpl_workflow_membership' : 'msg_tpl_workflow_contribution',
return $result;
}
+ /**
+ * @param $id
+ * @param $mode
+ *
+ * @return array|null
+ */
static function getPaymentProcessor($id, $mode) {
//FIX ME:
$sql = "
return FALSE;
}
+ /**
+ * @param $entityID
+ * @param string $entity
+ *
+ * @return null|Object
+ */
static function getSubscriptionDetails($entityID, $entity = 'recur') {
$sql = "
SELECT rec.id as recur_id,
$contributionSoft->delete();
}
+ /**
+ * @param $contact_id
+ * @param int $isTest
+ *
+ * @return array
+ */
static function getSoftContributionTotals($contact_id, $isTest = 0) {
$query = '
SELECT SUM(amount) as amount, AVG(total_amount) as average, cc.currency
return $softContribution;
}
+ /**
+ * @param $contributionID
+ * @param bool $isPCP
+ *
+ * @return array
+ */
static function getSoftCreditIds($contributionID , $isPCP = FALSE) {
$query = "
SELECT id
* @static
*/
+ /**
+ * @param $form
+ * @param $params
+ * @param $honoreeprofileId
+ * @param null $honorId
+ */
static function formatHonoreeProfileFields($form, $params, $honoreeprofileId, $honorId = NULL) {
$profileContactType = CRM_Core_BAO_UFGroup::getContactType($honoreeprofileId);
$profileFields = CRM_Core_BAO_UFGroup::getFields($honoreeprofileId);
// LCD 716 END
}
+ /**
+ * @param $query
+ */
static function where(&$query) {
$grouping = NULL;
}
}
+ /**
+ * @param $values
+ * @param $query
+ */
static function whereClauseSingle(&$values, &$query) {
list($name, $op, $value, $grouping, $wildcard) = $values;
}
}
+ /**
+ * @param $name
+ * @param $mode
+ * @param $side
+ *
+ * @return null|string
+ */
static function from($name, $mode, $side) {
$from = NULL;
switch ($name) {
return $from;
}
+ /**
+ * @param $query
+ */
static function initializeAnySoftCreditClause(&$query) {
if (self::isSoftCreditOptionEnabled($query->_params)) {
if ($query->_mode & CRM_Contact_BAO_Query::MODE_CONTRIBUTE) {
}
}
+ /**
+ * @param array $queryParams
+ *
+ * @return bool
+ */
static function isSoftCreditOptionEnabled($queryParams = array()) {
static $tempTableFilled = FALSE;
if (!empty($queryParams)) {
return FALSE;
}
+ /**
+ * @param bool $isExportMode
+ *
+ * @return array
+ */
static function softCreditReturnProperties($isExportMode = False) {
$properties = array(
'contribution_soft_credit_name' => 1,
return $properties;
}
+ /**
+ * @param $mode
+ * @param bool $includeCustomFields
+ *
+ * @return array|null
+ */
static function defaultReturnProperties($mode, $includeCustomFields = TRUE) {
$properties = NULL;
if ($mode & CRM_Contact_BAO_Query::MODE_CONTRIBUTE) {
$form->setDefaults(array('contribution_test' => 0));
}
+ /**
+ * @param $row
+ * @param $id
+ */
static function searchAction(&$row, $id) {
}
+ /**
+ * @param $tables
+ */
static function tableNames(&$tables) {
// Add contribution table
if (!empty($tables['civicrm_product'])) {
return TRUE;
}
+ /**
+ * @return array
+ */
static function getRecurringFields() {
return array(
'contribution_recur_start_date' => ts('Recurring Contribution Start Date'),
protected $_formType;
protected $_cdType;
+ /**
+ * @param $id
+ */
public function showRecordLinkMesssage($id) {
$statusId = CRM_Core_DAO::getFieldValue('CRM_Contribute_BAO_Contribution', $id, 'contribution_status_id');
if (CRM_Contribute_PseudoConstant::contributionStatus($statusId, 'name') == 'Partially paid') {
}
}
+ /**
+ * @param $id
+ * @param $values
+ */
public function buildValuesAndAssignOnline_Note_Type($id, &$values) {
$ids = array();
$params = array('id' => $id);
$this->assign('hidePayPalExpress', TRUE);
}
+ /**
+ * @param $submittedValues
+ *
+ * @return mixed
+ */
public function getCurrency($submittedValues) { // get current currency from DB or use default currency
$config = CRM_Core_Config::singleton();
return $result;
}
+ /**
+ * @param $financialTypeId
+ *
+ * @return array
+ */
public function getFinancialAccounts($financialTypeId) {
$financialAccounts = array();
CRM_Core_PseudoConstant::populate($financialAccounts,
return $financialAccounts;
}
+ /**
+ * @param $financialTypeId
+ * @param $relationTypeId
+ *
+ * @return mixed
+ */
public function getFinancialAccount($financialTypeId, $relationTypeId) {
$financialAccounts = $this->getFinancialAccounts($financialTypeId);
return CRM_Utils_Array::value($relationTypeId, $financialAccounts);
}
}
+ /**
+ * @param $submittedValues
+ *
+ * @return mixed
+ */
public function unsetCreditCardFields($submittedValues) {
//Offline Contribution.
$unsetParams = array(
}
}
+ /**
+ * This virtual function is used to set the default values of
+ * various form elements
+ *
+ * access public
+ *
+ * @return array reference to the array of default values
+ *
+ */
+ /**
+ * @return array
+ */
public function setDefaultValues() {
if ($this->_view == 'transaction' && ($this->_action & CRM_Core_Action::BROWSE)) {
return;
$this->addFormRule(array('CRM_Contribute_Form_AdditionalPayment', 'formRule'), $this);
}
+ /**
+ * @param $fields
+ * @param $files
+ * @param $self
+ *
+ * @return array
+ */
static function formRule($fields, $files, $self) {
$errors = array();
if ($self->_paymentType == 'owed' && $fields['total_amount'] > $self->_owed) {
}
}
+ /**
+ * @param $submittedValues
+ */
public function processCreditCard($submittedValues) {
$config = CRM_Core_Config::singleton();
$session = CRM_Core_Session::singleton();
}
}
+ /**
+ * @param $params
+ *
+ * @return mixed
+ */
function emailReceipt(&$params) {
// email receipt sending
// send message template
}
}
+ /**
+ * set the default values
+ *
+ * @return void
+ * @access public
+ */
+ /**
+ *
+ */
function setDefaultValues() {
// check if the user is registered and we have a contact ID
$contactID = $this->getContactID();
return empty($errors) ? TRUE : $errors;
}
+ /**
+ * @param $params
+ * @param $form
+ *
+ * @return int|mixed|null|string
+ */
public static function computeAmount(&$params, &$form) {
$amount = NULL;
return NULL;
}
+ /**
+ * Use the form name to create the tpl file name
+ *
+ * @return string
+ * @access public
+ */
+ /**
+ * @return string
+ */
function getTemplateFileName() {
$fileName = $this->checkTemplateFileExists();
return $fileName ? $fileName : parent::getTemplateFileName();
}
+ /**
+ * Default extra tpl file basically just replaces .tpl with .extra.tpl
+ * i.e. we dont override
+ *
+ * @return string
+ * @access public
+ */
+ /**
+ * @return string
+ */
function overrideExtraTemplateFileName() {
$fileName = $this->checkTemplateFileExists('extra.');
return $fileName ? $fileName : parent::overrideExtraTemplateFileName();
}
}
+ /**
+ * Use the form name to create the tpl file name
+ *
+ * @return string
+ * @access public
+ */
+ /**
+ * @return string
+ */
function getTemplateFileName() {
if ($this->controller->getPrint() || $this->getVar('_id') <= 0 ||
($this->_action & CRM_Core_Action::DELETE) ||
* Helper class to build navigation links
*/
class CRM_Contribute_Form_ContributionPage_TabHeader {
+ /**
+ * @param $form
+ *
+ * @return array
+ */
static function build(&$form) {
$tabs = $form->get('tabHeader');
if (!$tabs || empty($_GET['reset'])) {
return $tabs;
}
+ /**
+ * @param $form
+ *
+ * @return array
+ */
static function process(&$form) {
if ($form->getVar('_id') <= 0) {
return NULL;
return $tabs;
}
+ /**
+ * @param $form
+ */
static function reset(&$form) {
$tabs = self::process($form);
$form->set('tabHeader', $tabs);
}
+ /**
+ * @param $tabs
+ *
+ * @return int|string
+ */
static function getCurrentTab($tabs) {
static $current = FALSE;
);
}
+ /**
+ * This function sets the default values for the form. Note that in edit/view mode
+ * the default values are retrieved from the database
+ *
+ * @access public
+ *
+ * @return void
+ */
+ /**
+ *
+ */
function setDefaultValues() {
$defaults = array();
// check if there is a widget already created
self::preProcessCommon($this);
}
+ /**
+ * @param $form
+ * @param bool $useTable
+ */
static function preProcessCommon(&$form, $useTable = FALSE) {
$form->_contributionIds = array();
$this->assign('single', $this->_single);
}
+ /**
+ * This virtual function is used to set the default values of
+ * various form elements
+ *
+ * access public
+ *
+ * @return array reference to the array of default values
+ *
+ */
+ /**
+ * @return array
+ */
function setDefaultValues() {
$defaults = array();
if (isset($this->_activityId)) {
CRM_Core_Session::setStatus(ts('Contribution status has been updated for selected record(s).'), ts('Status Updated'), 'success');
}
+ /**
+ * @param $contributionIDs
+ *
+ * @return array
+ */
static function &getDetails($contributionIDs) {
$query = "
SELECT c.id as contribution_id,
CRM_Contribute_BAO_ContributionRecur::setSubscriptionContext();
}
+ /**
+ * This virtual function is used to set the default values of
+ * various form elements
+ *
+ * access public
+ *
+ * @return array reference to the array of default values
+ *
+ */
+ /**
+ * @return array
+ */
function setDefaultValues() {
$this->_defaults = array();
*/
public $_softCreditField;
+ /**
+ * @param $name
+ * @param $title
+ * @param int $type
+ * @param string $headerPattern
+ * @param string $dataPattern
+ * @param null $softCreditField
+ */
function __construct($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//', $softCreditField = NULL) {
$this->_name = $name;
$this->_title = $title;
$this->_value = $value;
}
+ /**
+ * @return bool
+ */
function validate() {
if (CRM_Utils_System::isNull($this->_value)) {
*/
protected $_haveColumnHeader;
+ /**
+ * @param $fileName
+ * @param string $seperator
+ * @param $mapper
+ * @param bool $skipColumnHeader
+ * @param int $mode
+ * @param int $contactType
+ * @param int $onDuplicate
+ *
+ * @return mixed
+ * @throws Exception
+ */
function run($fileName,
$seperator = ',',
&$mapper,
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldSoftCredit($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_softCreditField = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldSoftCreditType($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_softCreditType = $elements[$i];
return $params;
}
+ /**
+ * @param $name
+ * @param $title
+ * @param int $type
+ * @param string $headerPattern
+ * @param string $dataPattern
+ */
function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') {
if (empty($name)) {
$this->_fields['doNotImport'] = new CRM_Contribute_Import_Field($name, $title, $type, $headerPattern, $dataPattern);
fclose($fd);
}
+ /**
+ * Determines the file extension based on error code
+ *
+ * @var $type error code constant
+ * @return string
+ * @static
+ */
+ /**
+ * @param error $type
+ *
+ * @return string
+ */
static function errorFileName($type) {
$fileName = NULL;
if (empty($type)) {
return $fileName;
}
+ /**
+ * Determines the file name based on error code
+ *
+ * @var $type error code constant
+ * @return string
+ * @static
+ */
+ /**
+ * @param error $type
+ *
+ * @return string
+ */
static function saveFileName($type) {
$fileName = NULL;
if (empty($type)) {
protected $keyword = 'contribute';
// docs inherited from interface
+ /**
+ * Provides base information about the component.
+ * Needs to be implemented in component's information
+ * class.
+ *
+ * @return array collection of required component settings
+ * @access public
+ *
+ */
+ /**
+ * @return array
+ */
public function getInfo() {
return array(
'name' => 'CiviContribute',
}
// docs inherited from interface
+ /**
+ * Provides permissions that are used by component.
+ * Needs to be implemented in component's information
+ * class.
+ *
+ * NOTE: if using conditionally permission return,
+ * implementation of $getAllUnconditionally is required.
+ *
+ * @param bool $getAllUnconditionally
+ *
+ * @return array|null collection of permissions, null if none
+ * @access public
+ */
+ /**
+ * @param bool $getAllUnconditionally
+ *
+ * @return array|null
+ */
public function getPermissions($getAllUnconditionally = FALSE) {
return array(
'access CiviContribute',
);
}
+ /**
+ * Provides permissions that are unwise for Anonymous Roles to have
+ *
+ * @return array list of permissions
+ * @see CRM_Component_Info::getPermissions
+ */
+ /**
+ * @return array
+ */
public function getAnonymousPermissionWarnings() {
return array(
'access CiviContribute',
}
// docs inherited from interface
+ /**
+ * Provides information about user dashboard element
+ * offered by this component.
+ *
+ * @return array|null collection of required dashboard settings,
+ * null if no element offered
+ * @access public
+ *
+ */
+ /**
+ * @return array|null
+ */
public function getUserDashboardElement() {
return array('name' => ts('Contributions'),
'title' => ts('Your Contribution(s)'),
}
// docs inherited from interface
+ /**
+ * Provides information about user dashboard element
+ * offered by this component.
+ *
+ * @return array|null collection of required dashboard settings,
+ * null if no element offered
+ * @access public
+ *
+ */
+ /**
+ * @return array|null
+ */
public function registerTab() {
return array('title' => ts('Contributions'),
'url' => 'contribution',
}
// docs inherited from interface
+ /**
+ * Provides information about advanced search pane
+ * offered by this component.
+ *
+ * @return array|null collection of required pane settings,
+ * null if no element offered
+ * @access public
+ *
+ */
+ /**
+ * @return array|null
+ */
public function registerAdvancedSearchPane() {
return array(
'title' => ts('Contributions'),
}
// docs inherited from interface
+ /**
+ * Provides potential activity types that this
+ * component might want to register in activity history.
+ * Needs to be implemented in component's information
+ * class.
+ *
+ * @return array|null collection of activity types
+ * @access public
+ *
+ */
+ /**
+ * @return array|null
+ */
public function getActivityTypes() {
return NULL;
}
// add shortcut to Create New
+ /**
+ * @param $shortCuts
+ * @param $newCredit
+ */
public function creatNewShortcut(&$shortCuts, $newCredit) {
if (CRM_Core_Permission::check('access CiviContribute') &&
CRM_Core_Permission::check('edit contributions')
$form->run();
}
+ /**
+ * @param $params
+ * @param bool $sortBy
+ *
+ * @return int|string
+ */
function whereClause(&$params, $sortBy = TRUE) {
$values = $clauses = array();
$title = $this->get('title');
return implode(' AND ', $clauses);
}
+ /**
+ * @param $whereClause
+ * @param $whereParams
+ */
function pager($whereClause, $whereParams) {
$params['status'] = ts('Contribution %%StatusMessage%%');
$this->assign_by_ref('pager', $this->_pager);
}
+ /**
+ * @param $whereClause
+ * @param $whereParams
+ */
function pagerAtoZ($whereClause, $whereParams) {
$query = "
$this->assign('aToZ', $aToZBar);
}
+ /**
+ * @param $sectionsInfo
+ *
+ * @return array
+ */
function formatConfigureLinks($sectionsInfo) {
//build the formatted configure links.
$formattedConfLinks = self::configureActionLinks();
}
}
+ /**
+ * This function takes care of all the things common to all
+ * pages. This typically involves assigning the appropriate
+ * smarty variable :)
+ *
+ * @return string The content generated by running this page
+ */
+ /**
+ * @return string
+ */
function run() {
$this->preProcess();
if ($this->_action) {
return parent::run();
}
-}
\ No newline at end of file
+}
return self::$_columnHeaders;
}
+ /**
+ * @return mixed
+ */
function alphabetQuery() {
return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE);
}
+ /**
+ * @return string
+ */
function &getQuery() {
return $this->_query;
}
return ts('CiviCRM Contribution Search');
}
+ /**
+ * @return mixed
+ */
function getSummary() {
return $this->_query->summaryContribution($this->_context);
}
--- /dev/null
+<?php
+
+/*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.4 |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2013 |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM. |
+ | |
+ | CiviCRM is free software; you can copy, modify, and distribute it |
+ | under the terms of the GNU Affero General Public License |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | |
+ | CiviCRM is distributed in the hope that it will be useful, but |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
+ | See the GNU Affero General Public License for more details. |
+ | |
+ | You should have received a copy of the GNU Affero General Public |
+ | License and the CiviCRM Licensing Exception along |
+ | with this program; if not, contact CiviCRM LLC |
+ | at info[AT]civicrm[DOT]org. If you have questions about the |
+ | GNU Affero General Public License or the licensing of CiviCRM, |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+*/
+
+/**
+ * File for the CiviCRM APIv3 financial_transaction functions
+ *
+ * @package CiviCRM_APIv3
+ * @subpackage API_FinancialTransation
+ *
+ * @copyright CiviCRM LLC (c) 2004-2013
+ * @version $Id: FinancialTransation.php 2011-02-16 ErikHommel $
+ */
+
+/**
+ * Add an FinancialTransation for a contact
+ *
+ * Allowed @params array keys are:
+ *
+ * @example FinancialTransationCreate.php Standard Create Example
+ *
+ * @return array API result array
+ * {@getfields financial_transaction_create}
+ * @access public
+ */
+function civicrm_api3_financial_transaction_create($params) {
+ return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+}
+
+
+/**
+ * @param $params
+ */
+function _civicrm_api3_financial_transaction_create_spec(&$params) {
+ $params['trxn_date']['api.default'] = 'now';
+ $params['payment_instrument_id']['api.required'] = TRUE;
+ $params['total_amount']['api.required'] = TRUE;
+ $params['contribution_id']['api.required'] = TRUE;
+ $params['created_id']['api.default'] = 'user_contact_id';
+ $params['contribution_status_id'] = array('title' => 'Optional over-ride for status id');
+ $params['participant_status_id'] = array('title' => 'Optional Over-ride for participant id');
+ $params['send_receipt'] = array('title' => 'Send a receipt using built in template (possible future would be to specify the template)');
+}
+
+
+/**
+ * Deletes an existing FinancialTransation
+ *
+ * @param array $params
+ *
+ * @example FinancialTransationDelete.php Standard Delete Example
+ *
+ * @return boolean | error true if successfull, error otherwise
+ * {@getfields financial_transaction_delete}
+ * @access public
+ */
+function civicrm_api3_financial_transaction_delete($params) {
+ //return 'go away - you can't delete transactions';
+}
+
+/**
+ * Retrieve one or more financial_transactions
+ *
+ * @param array input parameters
+ *
+ *
+ * @example FinancialTransationGet.php Standard Get Example
+ *
+ * @param array $params an associative array of name/value pairs.
+ *
+ * @return array api result array
+ * {@getfields financial_transaction_get}
+ * @access public
+ */
+function civicrm_api3_financial_transaction_get($params) {
+
+ return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+}
+