3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * This api exposes CiviCRM Contribution records.
31 * @package CiviCRM_APIv3
35 * Add or update a Contribution.
37 * @param array $params
40 * @throws API_Exception
44 function civicrm_api3_contribution_create(&$params) {
46 _civicrm_api3_custom_format_params($params, $values, 'Contribution');
47 $params = array_merge($params, $values);
49 if (CRM_Financial_BAO_FinancialType
::isACLFinancialTypeStatus()) {
50 if (empty($params['id'])) {
51 $op = CRM_Core_Action
::ADD
;
54 if (empty($params['financial_type_id'])) {
55 $params['financial_type_id'] = CRM_Core_DAO
::getFieldValue('CRM_Contribute_DAO_Contribution', $params['id'], 'financial_type_id');
57 $op = CRM_Core_Action
::UPDATE
;
59 CRM_Financial_BAO_FinancialType
::getAvailableFinancialTypes($types, $op);
60 if (!in_array($params['financial_type_id'], array_keys($types))) {
61 return civicrm_api3_create_error('You do not have permission to create this contribution');
64 if (!empty($params['id']) && !empty($params['contribution_status_id'])) {
66 //throw error for invalid status change such as setting completed back to pending
67 //@todo this sort of validation belongs in the BAO not the API - if it is not an OK
68 // action it needs to be blocked there. If it is Ok through a form it needs to be OK through the api
69 CRM_Contribute_BAO_Contribution
::checkStatusValidation(NULL, $params, $error);
70 if (array_key_exists('contribution_status_id', $error)) {
71 throw new API_Exception($error['contribution_status_id']);
74 if (!empty($params['id']) && !empty($params['financial_type_id'])) {
76 CRM_Contribute_BAO_Contribution
::checkFinancialTypeChange($params['financial_type_id'], $params['id'], $error);
77 if (array_key_exists('financial_type_id', $error)) {
78 throw new API_Exception($error['financial_type_id']);
81 _civicrm_api3_contribution_create_legacy_support_45($params);
83 // Make sure tax calculation is handled via api.
84 // @todo this belongs in the BAO NOT the api.
85 $params = CRM_Contribute_BAO_Contribution
::checkTaxAmount($params);
87 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'Contribution');
91 * Adjust Metadata for Create action.
93 * The metadata is used for setting defaults, documentation & validation.
95 * @param array $params
96 * Array of parameters determined by getfields.
98 function _civicrm_api3_contribution_create_spec(&$params) {
99 $params['contact_id']['api.required'] = 1;
100 $params['total_amount']['api.required'] = 1;
101 $params['payment_instrument_id']['api.aliases'] = array('payment_instrument');
102 $params['receive_date']['api.default'] = 'now';
103 $params['payment_processor'] = array(
104 'name' => 'payment_processor',
105 'title' => 'Payment Processor ID',
106 'description' => 'ID of payment processor used for this contribution',
107 // field is called payment processor - not payment processor id but can only be one id so
108 // it seems likely someone will fix it up one day to be more consistent - lets alias it from the start
109 'api.aliases' => array('payment_processor_id'),
110 'type' => CRM_Utils_Type
::T_INT
,
112 $params['financial_type_id']['api.aliases'] = array('contribution_type_id', 'contribution_type');
113 $params['financial_type_id']['api.required'] = 1;
114 $params['note'] = array(
116 'uniqueName' => 'contribution_note',
119 'description' => 'Associated Note in the notes table',
121 $params['soft_credit_to'] = array(
122 'name' => 'soft_credit_to',
123 'title' => 'Soft Credit contact ID (legacy)',
124 'type' => CRM_Utils_Type
::T_INT
,
125 'description' => 'ID of Contact to be Soft credited to (deprecated - use contribution_soft api)',
126 'FKClassName' => 'CRM_Contact_DAO_Contact',
128 $params['honor_contact_id'] = array(
129 'name' => 'honor_contact_id',
130 'title' => 'Honoree contact ID (legacy)',
131 'type' => CRM_Utils_Type
::T_INT
,
132 'description' => 'ID of honoree contact (deprecated - use contribution_soft api)',
133 'FKClassName' => 'CRM_Contact_DAO_Contact',
135 $params['honor_type_id'] = array(
136 'name' => 'honor_type_id',
137 'title' => 'Honoree Type (legacy)',
138 'type' => CRM_Utils_Type
::T_INT
,
139 'description' => 'Type of honoree contact (deprecated - use contribution_soft api)',
140 'pseudoconstant' => TRUE,
142 // note this is a recommended option but not adding as a default to avoid
143 // creating unnecessary changes for the dev
144 $params['skipRecentView'] = array(
145 'name' => 'skipRecentView',
146 'title' => 'Skip adding to recent view',
147 'type' => CRM_Utils_Type
::T_BOOLEAN
,
148 'description' => 'Do not add to recent view (setting this improves performance)',
150 $params['skipLineItem'] = array(
151 'name' => 'skipLineItem',
152 'title' => 'Skip adding line items',
153 'type' => CRM_Utils_Type
::T_BOOLEAN
,
155 'description' => 'Do not add line items by default (if you wish to add your own)',
157 $params['batch_id'] = array(
159 'type' => CRM_Utils_Type
::T_INT
,
160 'description' => 'Batch which relevant transactions should be added to',
162 $params['refund_trxn_id'] = array(
163 'title' => 'Refund Transaction ID',
164 'type' => CRM_Utils_Type
::T_STRING
,
165 'description' => 'Transaction ID specific to the refund taking place',
170 * Support for schema changes made in 4.5.
172 * The main purpose of the API is to provide integrators a level of stability not provided by
173 * the core code or schema - this means we have to provide support for api calls (where possible)
174 * across schema changes.
176 * @param array $params
178 function _civicrm_api3_contribution_create_legacy_support_45(&$params) {
179 //legacy soft credit handling - recommended approach is chaining
180 if (!empty($params['soft_credit_to'])) {
181 $params['soft_credit'][] = array(
182 'contact_id' => $params['soft_credit_to'],
183 'amount' => $params['total_amount'],
184 'soft_credit_type_id' => CRM_Core_OptionGroup
::getDefaultValue("soft_credit_type"),
187 if (!empty($params['honor_contact_id'])) {
188 $params['soft_credit'][] = array(
189 'contact_id' => $params['honor_contact_id'],
190 'amount' => $params['total_amount'],
191 'soft_credit_type_id' => CRM_Utils_Array
::value('honor_type_id', $params, CRM_Core_OptionGroup
::getValue('soft_credit_type', 'in_honor_of', 'name')),
197 * Delete a Contribution.
199 * @param array $params
204 function civicrm_api3_contribution_delete($params) {
206 $contributionID = !empty($params['contribution_id']) ?
$params['contribution_id'] : $params['id'];
207 // First check contribution financial type
208 $financialType = CRM_Core_DAO
::getFieldValue('CRM_Contribute_DAO_Contribution', $contributionID, 'financial_type_id');
209 // Now check permissioned lineitems & permissioned contribution
210 if (CRM_Financial_BAO_FinancialType
::isACLFinancialTypeStatus()
211 && !CRM_Core_Permission
::check('delete contributions of type ' . CRM_Contribute_PseudoConstant
::financialType($financialType)) ||
212 !CRM_Financial_BAO_FinancialType
::checkPermissionedLineItems($contributionID, 'delete', FALSE)
214 return civicrm_api3_create_error('You do not have permission to delete this contribution');
216 if (CRM_Contribute_BAO_Contribution
::deleteContribution($contributionID)) {
217 return civicrm_api3_create_success(array($contributionID => 1));
220 return civicrm_api3_create_error('Could not delete contribution');
225 * Modify metadata for delete action.
227 * Legacy support for contribution_id.
229 * @param array $params
231 function _civicrm_api3_contribution_delete_spec(&$params) {
232 $params['id']['api.aliases'] = array('contribution_id');
236 * Retrieve a set of contributions.
238 * @param array $params
242 * Array of contributions, if error an array with an error id and error message
244 function civicrm_api3_contribution_get($params) {
246 $mode = CRM_Contact_BAO_Query
::MODE_CONTRIBUTE
;
247 $returnProperties = CRM_Contribute_BAO_Query
::defaultReturnProperties($mode);
249 $contributions = _civicrm_api3_get_using_query_object('Contribution', $params, array(), NULL, $mode, $returnProperties);
251 foreach ($contributions as $id => $contribution) {
252 $softContribution = CRM_Contribute_BAO_ContributionSoft
::getSoftContribution($id, TRUE);
253 $contributions[$id] = array_merge($contribution, $softContribution);
254 // format soft credit for backward compatibility
255 _civicrm_api3_format_soft_credit($contributions[$id]);
257 return civicrm_api3_create_success($contributions, $params, 'Contribution', 'get');
261 * Get number of contacts matching the supplied criteria.
263 * @param array $params
267 function civicrm_api3_contribution_getcount($params) {
268 $count = _civicrm_api3_get_using_query_object('Contribution', $params, array(), TRUE, CRM_Contact_BAO_Query
::MODE_CONTRIBUTE
);
273 * This function is used to format the soft credit for backward compatibility.
275 * As of v4.4 we support multiple soft credit, so now contribution returns array with 'soft_credit' as key
276 * but we still return first soft credit as a part of contribution array
278 * @param $contribution
280 function _civicrm_api3_format_soft_credit(&$contribution) {
281 if (!empty($contribution['soft_credit'])) {
282 $contribution['soft_credit_to'] = $contribution['soft_credit'][1]['contact_id'];
283 $contribution['soft_credit_id'] = $contribution['soft_credit'][1]['soft_credit_id'];
288 * Adjust Metadata for Get action.
290 * The metadata is used for setting defaults, documentation & validation.
292 * @param array $params
293 * Array of parameters determined by getfields.
295 function _civicrm_api3_contribution_get_spec(&$params) {
296 $params['contribution_test'] = array(
298 'type' => CRM_Utils_Type
::T_BOOLEAN
,
299 'title' => 'Get Test Contributions?',
300 'api.aliases' => array('is_test'),
303 $params['financial_type_id']['api.aliases'] = array('contribution_type_id');
304 $params['payment_instrument_id']['api.aliases'] = array('contribution_payment_instrument', 'payment_instrument');
305 $params['contact_id'] = $params['contribution_contact_id'];
306 $params['contact_id']['api.aliases'] = array('contribution_contact_id');
307 unset($params['contribution_contact_id']);
311 * Legacy handling for contribution parameters.
313 * Take the input parameter list as specified in the data model and
314 * convert it into the same format that we use in QF and BAO object.
316 * @param array $params
317 * property name/value pairs to insert in new contact.
318 * @param array $values
319 * The reformatted properties that we can use internally.
323 function _civicrm_api3_contribute_format_params($params, &$values) {
324 //legacy way of formatting from v2 api - v3 way is to define metadata & do it in the api layer
325 _civicrm_api3_filter_fields_for_bao('Contribution', $params, $values);
330 * Adjust Metadata for Transact action.
332 * The metadata is used for setting defaults, documentation & validation.
334 * @param array $params
335 * Array of parameters determined by getfields.
337 function _civicrm_api3_contribution_transact_spec(&$params) {
338 $fields = civicrm_api3('Contribution', 'getfields', array('action' => 'create'));
339 $params = array_merge($params, $fields['values']);
340 $params['receive_date']['api.default'] = 'now';
344 * Process a transaction and record it against the contact.
346 * @param array $params
350 * contribution of created or updated record (or a civicrm error)
352 function civicrm_api3_contribution_transact($params) {
353 // Set some params specific to payment processing
354 // @todo - fix this function - none of the results checked by civicrm_error would ever be an array with
356 // also trxn_id is not saved.
357 // but since there is no test it's not desirable to jump in & make the obvious changes.
358 $params['payment_processor_mode'] = empty($params['is_test']) ?
'live' : 'test';
359 $params['amount'] = $params['total_amount'];
360 if (!isset($params['net_amount'])) {
361 $params['net_amount'] = $params['amount'];
363 if (!isset($params['invoiceID']) && isset($params['invoice_id'])) {
364 $params['invoiceID'] = $params['invoice_id'];
367 // Some payment processors expect a unique invoice_id - generate one if not supplied
368 $params['invoice_id'] = CRM_Utils_Array
::value('invoice_id', $params, md5(uniqid(rand(), TRUE)));
370 $paymentProcessor = CRM_Financial_BAO_PaymentProcessor
::getPayment($params['payment_processor'], $params['payment_processor_mode']);
371 $paymentProcessor['object']->doPayment($params);
373 $params['payment_instrument_id'] = CRM_Core_DAO
::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', $paymentProcessor['payment_processor_type_id'], 'payment_type') == 1 ?
'Credit Card' : 'Debit Card';
374 return civicrm_api('Contribution', 'create', $params);
378 * Send a contribution confirmation (receipt or invoice).
380 * The appropriate online template will be used (the existence of related objects
381 * (e.g. memberships ) will affect this selection
383 * @param array $params
388 function civicrm_api3_contribution_sendconfirmation($params) {
389 $contribution = new CRM_Contribute_BAO_Contribution();
390 $contribution->id
= $params['id'];
391 if (!$contribution->find(TRUE)) {
392 throw new Exception('Contribution does not exist');
394 $input = $ids = $cvalues = array('receipt_from_email' => $params['receipt_from_email']);
395 $contribution->loadRelatedObjects($input, $ids, TRUE);
396 $contribution->composeMessageArray($input, $ids, $cvalues, FALSE, FALSE);
400 * Adjust Metadata for sendconfirmation action.
402 * The metadata is used for setting defaults, documentation & validation.
404 * @param array $params
405 * Array of parameters determined by getfields.
407 function _civicrm_api3_contribution_sendconfirmation_spec(&$params) {
408 $params['id'] = array(
410 'title' => 'Contribution ID',
411 'type' => CRM_Utils_Type
::T_INT
,
413 $params['receipt_from_email'] = array(
415 'title' => 'From Email address (string) required until someone provides a patch :-)',
416 'type' => CRM_Utils_Type
::T_STRING
,
418 $params['receipt_from_name'] = array(
419 'title' => 'From Name (string)',
420 'type' => CRM_Utils_Type
::T_STRING
,
422 $params['cc_receipt'] = array(
423 'title' => 'CC Email address (string)',
424 'type' => CRM_Utils_Type
::T_STRING
,
426 $params['bcc_receipt'] = array(
427 'title' => 'BCC Email address (string)',
428 'type' => CRM_Utils_Type
::T_STRING
,
430 $params['receipt_text'] = array(
431 'title' => 'Message (string)',
432 'type' => CRM_Utils_Type
::T_STRING
,
437 * Complete an existing (pending) transaction.
439 * This will update related entities (participant, membership, pledge etc)
440 * and take any complete actions from the contribution page (e.g. send receipt).
442 * @todo - most of this should live in the BAO layer but as we want it to be an addition
443 * to 4.3 which is already stable we should add it to the api layer & re-factor into the BAO layer later
445 * @param array $params
448 * @throws API_Exception
451 function civicrm_api3_contribution_completetransaction(&$params) {
453 $input = $ids = array();
454 if (isset($params['payment_processor_id'])) {
455 $input['payment_processor_id'] = $params['payment_processor_id'];
457 $contribution = new CRM_Contribute_BAO_Contribution();
458 $contribution->id
= $params['id'];
459 $contribution->find(TRUE);
460 if (!$contribution->id
== $params['id']) {
461 throw new API_Exception('A valid contribution ID is required', 'invalid_data');
464 if (!$contribution->loadRelatedObjects($input, $ids, TRUE)) {
465 throw new API_Exception('failed to load related objects');
467 elseif ($contribution->contribution_status_id
== CRM_Core_OptionGroup
::getValue('contribution_status', 'Completed', 'name')) {
468 throw new API_Exception(ts('Contribution already completed'), 'contribution_completed');
470 $input['trxn_id'] = !empty($params['trxn_id']) ?
$params['trxn_id'] : $contribution->trxn_id
;
471 if (!empty($params['fee_amount'])) {
472 $input['fee_amount'] = $params['fee_amount'];
474 $params = _ipn_process_transaction($params, $contribution, $input, $ids);
479 * Provide function metadata.
481 * @param array $params
483 function _civicrm_api3_contribution_completetransaction_spec(&$params) {
484 $params['id'] = array(
485 'title' => 'Contribution ID',
486 'type' => CRM_Utils_Type
::T_INT
,
487 'api.required' => TRUE,
489 $params['trxn_id'] = array(
490 'title' => 'Transaction ID',
491 'type' => CRM_Utils_Type
::T_STRING
,
493 $params['is_email_receipt'] = array(
494 'title' => 'Send email Receipt?',
495 'type' => CRM_Utils_Type
::T_BOOLEAN
,
497 $params['receipt_from_email'] = array(
498 'title' => 'Email to send receipt from.',
499 'description' => 'If not provided this will default to being based on domain mail or contribution page',
500 'type' => CRM_Utils_Type
::T_EMAIL
,
502 $params['receipt_from_name'] = array(
503 'title' => 'Name to send receipt from',
504 'description' => '. If not provided this will default to domain mail or contribution page',
505 'type' => CRM_Utils_Type
::T_STRING
,
507 $params['payment_processor_id'] = array(
508 'title' => 'Payment processor ID',
509 'description' => 'Providing this is strongly recommended, as not possible to calculate it accurately always',
510 'type' => CRM_Utils_Type
::T_INT
,
512 $params['fee_amount'] = array(
513 'title' => 'Fee charged on transaction',
514 'description' => 'If a fee has been charged then the amount',
515 'type' => CRM_Utils_Type
::T_FLOAT
,
517 $params['trxn_date'] = array(
518 'title' => 'Transaction Date',
519 'description' => 'Date this transaction occurred',
520 'type' => CRM_Utils_Type
::T_DATE
,
525 * Complete an existing (pending) transaction.
527 * This will update related entities (participant, membership, pledge etc)
528 * and take any complete actions from the contribution page (e.g. send receipt).
530 * @todo - most of this should live in the BAO layer but as we want it to be an addition
531 * to 4.3 which is already stable we should add it to the api layer & re-factor into the BAO layer later
533 * @param array $params
536 * @throws API_Exception
539 function civicrm_api3_contribution_repeattransaction(&$params) {
540 $input = $ids = array();
541 civicrm_api3_verify_one_mandatory($params, NULL, array('contribution_recur_id', 'original_contribution_id'));
542 if (empty($params['original_contribution_id'])) {
543 $params['original_contribution_id'] = civicrm_api3('contribution', 'getvalue', array(
545 'contribution_recur_id' => $params['contribution_recur_id'],
546 'options' => array('limit' => 1, 'sort' => 'id DESC'),
549 $contribution = new CRM_Contribute_BAO_Contribution();
550 $contribution->id
= $params['original_contribution_id'];
551 if (!$contribution->find(TRUE)) {
552 throw new API_Exception(
553 'A valid original contribution ID is required', 'invalid_data');
555 $original_contribution = clone $contribution;
557 if (!$contribution->loadRelatedObjects($input, $ids, TRUE)) {
558 throw new API_Exception('failed to load related objects');
561 unset($contribution->id
, $contribution->receive_date
, $contribution->invoice_id
);
562 $contribution->contribution_status_id
= $params['contribution_status_id'];
563 $contribution->receive_date
= $params['receive_date'];
565 $passThroughParams = array('trxn_id', 'total_amount', 'campaign_id', 'fee_amount', 'financial_type_id');
566 $input = array_intersect_key($params, array_fill_keys($passThroughParams, NULL));
568 $params = _ipn_process_transaction($params, $contribution, $input, $ids, $original_contribution);
570 catch(Exception
$e) {
571 throw new API_Exception('failed to load related objects' . $e->getMessage() . "\n" . $e->getTraceAsString());
576 * Calls IPN complete transaction for completing or repeating a transaction.
578 * The IPN function is overloaded with two purposes - this is simply a wrapper for that
579 * when separating them in the api layer.
581 * @param array $params
582 * @param CRM_Contribute_BAO_Contribution $contribution
583 * @param array $input
587 * @param CRM_Contribute_BAO_Contribution $firstContribution
591 function _ipn_process_transaction(&$params, $contribution, $input, $ids, $firstContribution = NULL) {
592 $objects = $contribution->_relatedObjects
;
593 $objects['contribution'] = &$contribution;
595 if ($firstContribution) {
596 $objects['first_contribution'] = $firstContribution;
598 $input['component'] = $contribution->_component
;
599 $input['is_test'] = $contribution->is_test
;
600 $input['amount'] = empty($input['total_amount']) ?
$contribution->total_amount
: $input['total_amount'];
602 if (isset($params['is_email_receipt'])) {
603 $input['is_email_receipt'] = $params['is_email_receipt'];
605 if (!empty($params['trxn_date'])) {
606 $input['trxn_date'] = $params['trxn_date'];
608 if (empty($contribution->contribution_page_id
)) {
609 static $domainFromName;
610 static $domainFromEmail;
611 if (empty($domainFromEmail) && (empty($params['receipt_from_name']) ||
empty($params['receipt_from_email']))) {
612 list($domainFromName, $domainFromEmail) = CRM_Core_BAO_Domain
::getNameAndEmail(TRUE);
614 $input['receipt_from_name'] = CRM_Utils_Array
::value('receipt_from_name', $params, $domainFromName);
615 $input['receipt_from_email'] = CRM_Utils_Array
::value('receipt_from_email', $params, $domainFromEmail);
617 $transaction = new CRM_Core_Transaction();
618 CRM_Contribute_BAO_Contribution
::completeOrder($input, $ids, $objects, $transaction, !empty($contribution->contribution_recur_id
), $contribution,
624 * Provide function metadata.
626 * @param array $params
628 function _civicrm_api3_contribution_repeattransaction_spec(&$params) {
629 $params['original_contribution_id'] = array(
630 'title' => 'Original Contribution ID',
631 'description' => 'Contribution ID to copy (will be calculated from recurring contribution if not provided)',
632 'type' => CRM_Utils_Type
::T_INT
,
634 $params['contribution_recur_id'] = array(
635 'title' => 'Recurring contribution ID',
636 'type' => CRM_Utils_Type
::T_INT
,
638 $params['trxn_id'] = array(
639 'title' => 'Transaction ID',
640 'type' => CRM_Utils_Type
::T_STRING
,
642 $params['is_email_receipt'] = array(
643 'title' => 'Send email Receipt?',
644 'type' => CRM_Utils_Type
::T_BOOLEAN
,
646 $params['contribution_status_id'] = array(
647 'title' => 'Contribution Status ID',
648 'name' => 'contribution_status_id',
649 'type' => CRM_Utils_Type
::T_INT
,
650 'pseudoconstant' => array(
651 'optionGroupName' => 'contribution_status',
653 'api.required' => TRUE,
655 $params['receive_date'] = array(
656 'title' => 'Contribution Receive Date',
657 'name' => 'receive_date',
658 'type' => CRM_Utils_Type
::T_DATE
,
659 'api.default' => 'now',
661 $params['trxn_id'] = array(
662 'title' => 'Transaction ID',
664 'type' => CRM_Utils_Type
::T_STRING
,
666 $params['campaign_id'] = array(
667 'title' => 'Campaign ID',
668 'name' => 'campaign_id',
669 'type' => CRM_Utils_Type
::T_INT
,
670 'pseudoconstant' => array(
671 'table' => 'civicrm_campaign',
673 'labelColumn' => 'title',
676 $params['financial_type_id'] = array(
677 'title' => 'Financial ID (ignored if more than one line item)',
678 'name' => 'financial_type_id',
679 'type' => CRM_Utils_Type
::T_INT
,
680 'pseudoconstant' => array(
681 'table' => 'civicrm_financial_type',
683 'labelColumn' => 'name',
686 $params['payment_processor_id'] = array(
687 'description' => ts('Payment processor ID, will be loaded from contribution_recur if not provided'),
688 'title' => 'Payment processor ID',
689 'name' => 'payment_processor_id',
690 'type' => CRM_Utils_Type
::T_INT
,