3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'Contribution');
87 * Adjust Metadata for Create action.
89 * The metadata is used for setting defaults, documentation & validation.
91 * @param array $params
92 * Array of parameters determined by getfields.
94 function _civicrm_api3_contribution_create_spec(&$params) {
95 $params['contact_id']['api.required'] = 1;
96 $params['total_amount']['api.required'] = 1;
97 $params['payment_instrument_id']['api.aliases'] = array('payment_instrument');
98 $params['receive_date']['api.default'] = 'now';
99 $params['payment_processor'] = array(
100 'name' => 'payment_processor',
101 'title' => 'Payment Processor ID',
102 'description' => 'ID of payment processor used for this contribution',
103 // field is called payment processor - not payment processor id but can only be one id so
104 // it seems likely someone will fix it up one day to be more consistent - lets alias it from the start
105 'api.aliases' => array('payment_processor_id'),
106 'type' => CRM_Utils_Type
::T_INT
,
108 $params['financial_type_id']['api.aliases'] = array('contribution_type_id', 'contribution_type');
109 $params['financial_type_id']['api.required'] = 1;
110 $params['note'] = array(
112 'uniqueName' => 'contribution_note',
115 'description' => 'Associated Note in the notes table',
117 $params['soft_credit_to'] = array(
118 'name' => 'soft_credit_to',
119 'title' => 'Soft Credit contact ID (legacy)',
120 'type' => CRM_Utils_Type
::T_INT
,
121 'description' => 'ID of Contact to be Soft credited to (deprecated - use contribution_soft api)',
122 'FKClassName' => 'CRM_Contact_DAO_Contact',
124 $params['honor_contact_id'] = array(
125 'name' => 'honor_contact_id',
126 'title' => 'Honoree contact ID (legacy)',
127 'type' => CRM_Utils_Type
::T_INT
,
128 'description' => 'ID of honoree contact (deprecated - use contribution_soft api)',
129 'FKClassName' => 'CRM_Contact_DAO_Contact',
131 $params['honor_type_id'] = array(
132 'name' => 'honor_type_id',
133 'title' => 'Honoree Type (legacy)',
134 'type' => CRM_Utils_Type
::T_INT
,
135 'description' => 'Type of honoree contact (deprecated - use contribution_soft api)',
136 'pseudoconstant' => TRUE,
138 // note this is a recommended option but not adding as a default to avoid
139 // creating unnecessary changes for the dev
140 $params['skipRecentView'] = array(
141 'name' => 'skipRecentView',
142 'title' => 'Skip adding to recent view',
143 'type' => CRM_Utils_Type
::T_BOOLEAN
,
144 'description' => 'Do not add to recent view (setting this improves performance)',
146 $params['skipLineItem'] = array(
147 'name' => 'skipLineItem',
148 'title' => 'Skip adding line items',
149 'type' => CRM_Utils_Type
::T_BOOLEAN
,
151 'description' => 'Do not add line items by default (if you wish to add your own)',
153 $params['batch_id'] = array(
155 'type' => CRM_Utils_Type
::T_INT
,
156 'description' => 'Batch which relevant transactions should be added to',
158 $params['refund_trxn_id'] = array(
159 'title' => 'Refund Transaction ID',
160 'type' => CRM_Utils_Type
::T_STRING
,
161 'description' => 'Transaction ID specific to the refund taking place',
166 * Support for schema changes made in 4.5.
168 * The main purpose of the API is to provide integrators a level of stability not provided by
169 * the core code or schema - this means we have to provide support for api calls (where possible)
170 * across schema changes.
172 * @param array $params
174 function _civicrm_api3_contribution_create_legacy_support_45(&$params) {
175 //legacy soft credit handling - recommended approach is chaining
176 if (!empty($params['soft_credit_to'])) {
177 $params['soft_credit'][] = array(
178 'contact_id' => $params['soft_credit_to'],
179 'amount' => $params['total_amount'],
180 'soft_credit_type_id' => CRM_Core_OptionGroup
::getDefaultValue("soft_credit_type"),
183 if (!empty($params['honor_contact_id'])) {
184 $params['soft_credit'][] = array(
185 'contact_id' => $params['honor_contact_id'],
186 'amount' => $params['total_amount'],
187 'soft_credit_type_id' => CRM_Utils_Array
::value('honor_type_id', $params, CRM_Core_OptionGroup
::getValue('soft_credit_type', 'in_honor_of', 'name')),
193 * Delete a Contribution.
195 * @param array $params
200 function civicrm_api3_contribution_delete($params) {
202 $contributionID = !empty($params['contribution_id']) ?
$params['contribution_id'] : $params['id'];
203 // First check contribution financial type
204 $financialType = CRM_Core_DAO
::getFieldValue('CRM_Contribute_DAO_Contribution', $contributionID, 'financial_type_id');
205 // Now check permissioned lineitems & permissioned contribution
206 if (CRM_Financial_BAO_FinancialType
::isACLFinancialTypeStatus()
207 && !CRM_Core_Permission
::check('delete contributions of type ' . CRM_Contribute_PseudoConstant
::financialType($financialType)) ||
208 !CRM_Financial_BAO_FinancialType
::checkPermissionedLineItems($contributionID, 'delete', FALSE)
210 return civicrm_api3_create_error('You do not have permission to delete this contribution');
212 if (CRM_Contribute_BAO_Contribution
::deleteContribution($contributionID)) {
213 return civicrm_api3_create_success(array($contributionID => 1));
216 return civicrm_api3_create_error('Could not delete contribution');
221 * Modify metadata for delete action.
223 * Legacy support for contribution_id.
225 * @param array $params
227 function _civicrm_api3_contribution_delete_spec(&$params) {
228 $params['id']['api.aliases'] = array('contribution_id');
232 * Retrieve a set of contributions.
234 * @param array $params
238 * Array of contributions, if error an array with an error id and error message
240 function civicrm_api3_contribution_get($params) {
242 $mode = CRM_Contact_BAO_Query
::MODE_CONTRIBUTE
;
243 $returnProperties = CRM_Contribute_BAO_Query
::defaultReturnProperties($mode);
245 $contributions = _civicrm_api3_get_using_query_object('Contribution', $params, array(), NULL, $mode, $returnProperties);
247 foreach ($contributions as $id => $contribution) {
248 $softContribution = CRM_Contribute_BAO_ContributionSoft
::getSoftContribution($id, TRUE);
249 $contributions[$id] = array_merge($contribution, $softContribution);
250 // format soft credit for backward compatibility
251 _civicrm_api3_format_soft_credit($contributions[$id]);
253 return civicrm_api3_create_success($contributions, $params, 'Contribution', 'get');
257 * Get number of contacts matching the supplied criteria.
259 * @param array $params
263 function civicrm_api3_contribution_getcount($params) {
264 $count = _civicrm_api3_get_using_query_object('Contribution', $params, array(), TRUE, CRM_Contact_BAO_Query
::MODE_CONTRIBUTE
);
269 * This function is used to format the soft credit for backward compatibility.
271 * As of v4.4 we support multiple soft credit, so now contribution returns array with 'soft_credit' as key
272 * but we still return first soft credit as a part of contribution array
274 * @param $contribution
276 function _civicrm_api3_format_soft_credit(&$contribution) {
277 if (!empty($contribution['soft_credit'])) {
278 $contribution['soft_credit_to'] = $contribution['soft_credit'][1]['contact_id'];
279 $contribution['soft_credit_id'] = $contribution['soft_credit'][1]['soft_credit_id'];
284 * Adjust Metadata for Get action.
286 * The metadata is used for setting defaults, documentation & validation.
288 * @param array $params
289 * Array of parameters determined by getfields.
291 function _civicrm_api3_contribution_get_spec(&$params) {
292 $params['contribution_test'] = array(
294 'type' => CRM_Utils_Type
::T_BOOLEAN
,
295 'title' => 'Get Test Contributions?',
296 'api.aliases' => array('is_test'),
299 $params['financial_type_id']['api.aliases'] = array('contribution_type_id');
300 $params['payment_instrument_id']['api.aliases'] = array('contribution_payment_instrument', 'payment_instrument');
301 $params['contact_id'] = $params['contribution_contact_id'];
302 $params['contact_id']['api.aliases'] = array('contribution_contact_id');
303 unset($params['contribution_contact_id']);
307 * Legacy handling for contribution parameters.
309 * Take the input parameter list as specified in the data model and
310 * convert it into the same format that we use in QF and BAO object.
312 * @param array $params
313 * property name/value pairs to insert in new contact.
314 * @param array $values
315 * The reformatted properties that we can use internally.
319 function _civicrm_api3_contribute_format_params($params, &$values) {
320 //legacy way of formatting from v2 api - v3 way is to define metadata & do it in the api layer
321 _civicrm_api3_filter_fields_for_bao('Contribution', $params, $values);
326 * Adjust Metadata for Transact action.
328 * The metadata is used for setting defaults, documentation & validation.
330 * @param array $params
331 * Array of parameters determined by getfields.
333 function _civicrm_api3_contribution_transact_spec(&$params) {
334 $fields = civicrm_api3('Contribution', 'getfields', array('action' => 'create'));
335 $params = array_merge($params, $fields['values']);
336 $params['receive_date']['api.default'] = 'now';
340 * Process a transaction and record it against the contact.
342 * @param array $params
346 * contribution of created or updated record (or a civicrm error)
348 function civicrm_api3_contribution_transact($params) {
349 // Set some params specific to payment processing
350 // @todo - fix this function - none of the results checked by civicrm_error would ever be an array with
352 // also trxn_id is not saved.
353 // but since there is no test it's not desirable to jump in & make the obvious changes.
354 $params['payment_processor_mode'] = empty($params['is_test']) ?
'live' : 'test';
355 $params['amount'] = $params['total_amount'];
356 if (!isset($params['net_amount'])) {
357 $params['net_amount'] = $params['amount'];
359 if (!isset($params['invoiceID']) && isset($params['invoice_id'])) {
360 $params['invoiceID'] = $params['invoice_id'];
363 // Some payment processors expect a unique invoice_id - generate one if not supplied
364 $params['invoice_id'] = CRM_Utils_Array
::value('invoice_id', $params, md5(uniqid(rand(), TRUE)));
366 $paymentProcessor = CRM_Financial_BAO_PaymentProcessor
::getPayment($params['payment_processor'], $params['payment_processor_mode']);
367 $paymentProcessor['object']->doPayment($params);
369 $params['payment_instrument_id'] = CRM_Core_DAO
::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', $paymentProcessor['payment_processor_type_id'], 'payment_type') == 1 ?
'Credit Card' : 'Debit Card';
370 return civicrm_api('Contribution', 'create', $params);
374 * Send a contribution confirmation (receipt or invoice).
376 * The appropriate online template will be used (the existence of related objects
377 * (e.g. memberships ) will affect this selection
379 * @param array $params
384 function civicrm_api3_contribution_sendconfirmation($params) {
385 $ids = $values = array();
386 $allowedParams = array(
387 'receipt_from_email',
393 'payment_processor_id',
395 $input = array_intersect_key($params, array_flip($allowedParams));
396 CRM_Contribute_BAO_Contribution
::sendMail($input, $ids, $params['id'], $values);
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' => ts('Contribution ID'),
411 'type' => CRM_Utils_Type
::T_INT
,
413 $params['receipt_from_email'] = array(
414 'title' => ts('From Email address (string)'),
415 'type' => CRM_Utils_Type
::T_STRING
,
417 $params['receipt_from_name'] = array(
418 'title' => ts('From Name (string)'),
419 'type' => CRM_Utils_Type
::T_STRING
,
421 $params['cc_receipt'] = array(
422 'title' => ts('CC Email address (string)'),
423 'type' => CRM_Utils_Type
::T_STRING
,
425 $params['bcc_receipt'] = array(
426 'title' => ts('BCC Email address (string)'),
427 'type' => CRM_Utils_Type
::T_STRING
,
429 $params['receipt_text'] = array(
430 'title' => ts('Message (string)'),
431 'type' => CRM_Utils_Type
::T_STRING
,
433 $params['receipt_update'] = array(
434 'title' => ts('Update the Receipt Date'),
435 'type' => CRM_Utils_Type
::T_BOOLEAN
,
436 'api.default' => TRUE,
438 $params['payment_processor_id'] = array(
439 'title' => ts('Payment processor Id (avoids mis-guesses)'),
440 'type' => CRM_Utils_Type
::T_INT
,
445 * Complete an existing (pending) transaction.
447 * This will update related entities (participant, membership, pledge etc)
448 * and take any complete actions from the contribution page (e.g. send receipt).
450 * @todo - most of this should live in the BAO layer but as we want it to be an addition
451 * to 4.3 which is already stable we should add it to the api layer & re-factor into the BAO layer later
453 * @param array $params
458 * @throws \API_Exception
459 * @throws \CRM_Core_Exception
462 function civicrm_api3_contribution_completetransaction(&$params) {
464 $input = $ids = array();
465 if (isset($params['payment_processor_id'])) {
466 $input['payment_processor_id'] = $params['payment_processor_id'];
468 $contribution = new CRM_Contribute_BAO_Contribution();
469 $contribution->id
= $params['id'];
470 $contribution->find(TRUE);
471 if (!$contribution->id
== $params['id']) {
472 throw new API_Exception('A valid contribution ID is required', 'invalid_data');
475 if (!$contribution->loadRelatedObjects($input, $ids, TRUE)) {
476 throw new API_Exception('failed to load related objects');
478 elseif ($contribution->contribution_status_id
== CRM_Core_OptionGroup
::getValue('contribution_status', 'Completed', 'name')) {
479 throw new API_Exception(ts('Contribution already completed'), 'contribution_completed');
481 $input['trxn_id'] = !empty($params['trxn_id']) ?
$params['trxn_id'] : $contribution->trxn_id
;
482 if (!empty($params['fee_amount'])) {
483 $input['fee_amount'] = $params['fee_amount'];
485 return _ipn_process_transaction($params, $contribution, $input, $ids);
490 * Provide function metadata.
492 * @param array $params
494 function _civicrm_api3_contribution_completetransaction_spec(&$params) {
495 $params['id'] = array(
496 'title' => 'Contribution ID',
497 'type' => CRM_Utils_Type
::T_INT
,
498 'api.required' => TRUE,
500 $params['trxn_id'] = array(
501 'title' => 'Transaction ID',
502 'type' => CRM_Utils_Type
::T_STRING
,
504 $params['is_email_receipt'] = array(
505 'title' => 'Send email Receipt?',
506 'type' => CRM_Utils_Type
::T_BOOLEAN
,
508 $params['receipt_from_email'] = array(
509 'title' => 'Email to send receipt from.',
510 'description' => 'If not provided this will default to being based on domain mail or contribution page',
511 'type' => CRM_Utils_Type
::T_EMAIL
,
513 $params['receipt_from_name'] = array(
514 'title' => 'Name to send receipt from',
515 'description' => '. If not provided this will default to domain mail or contribution page',
516 'type' => CRM_Utils_Type
::T_STRING
,
518 $params['payment_processor_id'] = array(
519 'title' => 'Payment processor ID',
520 'description' => 'Providing this is strongly recommended, as not possible to calculate it accurately always',
521 'type' => CRM_Utils_Type
::T_INT
,
523 $params['fee_amount'] = array(
524 'title' => 'Fee charged on transaction',
525 'description' => 'If a fee has been charged then the amount',
526 'type' => CRM_Utils_Type
::T_FLOAT
,
528 $params['trxn_date'] = array(
529 'title' => 'Transaction Date',
530 'description' => 'Date this transaction occurred',
531 'type' => CRM_Utils_Type
::T_DATE
,
536 * Complete an existing (pending) transaction.
538 * This will update related entities (participant, membership, pledge etc)
539 * and take any complete actions from the contribution page (e.g. send receipt).
541 * @todo - most of this should live in the BAO layer but as we want it to be an addition
542 * to 4.3 which is already stable we should add it to the api layer & re-factor into the BAO layer later
544 * @param array $params
547 * @throws API_Exception
550 function civicrm_api3_contribution_repeattransaction(&$params) {
551 $input = $ids = array();
552 civicrm_api3_verify_one_mandatory($params, NULL, array('contribution_recur_id', 'original_contribution_id'));
553 if (empty($params['original_contribution_id'])) {
554 $params['original_contribution_id'] = civicrm_api3('contribution', 'getvalue', array(
556 'contribution_recur_id' => $params['contribution_recur_id'],
557 'options' => array('limit' => 1, 'sort' => 'id DESC'),
560 $contribution = new CRM_Contribute_BAO_Contribution();
561 $contribution->id
= $params['original_contribution_id'];
562 if (!$contribution->find(TRUE)) {
563 throw new API_Exception(
564 'A valid original contribution ID is required', 'invalid_data');
566 $original_contribution = clone $contribution;
567 $input['payment_processor_id'] = civicrm_api3('contributionRecur', 'getvalue', array(
568 'return' => 'payment_processor_id',
569 'id' => $contribution->contribution_recur_id
,
572 if (!$contribution->loadRelatedObjects($input, $ids, TRUE)) {
573 throw new API_Exception('failed to load related objects');
576 unset($contribution->id
, $contribution->receive_date
, $contribution->invoice_id
);
577 $contribution->receive_date
= $params['receive_date'];
579 $passThroughParams = array(
585 'contribution_status_id',
587 $input = array_intersect_key($params, array_fill_keys($passThroughParams, NULL));
589 return _ipn_process_transaction($params, $contribution, $input, $ids, $original_contribution);
591 catch(Exception
$e) {
592 throw new API_Exception('failed to load related objects' . $e->getMessage() . "\n" . $e->getTraceAsString());
597 * Calls IPN complete transaction for completing or repeating a transaction.
599 * The IPN function is overloaded with two purposes - this is simply a wrapper for that
600 * when separating them in the api layer.
602 * @param array $params
603 * @param CRM_Contribute_BAO_Contribution $contribution
604 * @param array $input
608 * @param CRM_Contribute_BAO_Contribution $firstContribution
612 function _ipn_process_transaction(&$params, $contribution, $input, $ids, $firstContribution = NULL) {
613 $objects = $contribution->_relatedObjects
;
614 $objects['contribution'] = &$contribution;
616 if ($firstContribution) {
617 $objects['first_contribution'] = $firstContribution;
619 $input['component'] = $contribution->_component
;
620 $input['is_test'] = $contribution->is_test
;
621 $input['amount'] = empty($input['total_amount']) ?
$contribution->total_amount
: $input['total_amount'];
623 if (isset($params['is_email_receipt'])) {
624 $input['is_email_receipt'] = $params['is_email_receipt'];
626 if (!empty($params['trxn_date'])) {
627 $input['trxn_date'] = $params['trxn_date'];
629 if (!empty($params['receive_date'])) {
630 $input['receive_date'] = $params['receive_date'];
632 if (empty($contribution->contribution_page_id
)) {
633 static $domainFromName;
634 static $domainFromEmail;
635 if (empty($domainFromEmail) && (empty($params['receipt_from_name']) ||
empty($params['receipt_from_email']))) {
636 list($domainFromName, $domainFromEmail) = CRM_Core_BAO_Domain
::getNameAndEmail(TRUE);
638 $input['receipt_from_name'] = CRM_Utils_Array
::value('receipt_from_name', $params, $domainFromName);
639 $input['receipt_from_email'] = CRM_Utils_Array
::value('receipt_from_email', $params, $domainFromEmail);
641 $transaction = new CRM_Core_Transaction();
642 return CRM_Contribute_BAO_Contribution
::completeOrder($input, $ids, $objects, $transaction, !empty
643 ($contribution->contribution_recur_id
), $contribution,
648 * Provide function metadata.
650 * @param array $params
652 function _civicrm_api3_contribution_repeattransaction_spec(&$params) {
653 $params['original_contribution_id'] = array(
654 'title' => 'Original Contribution ID',
655 'description' => 'Contribution ID to copy (will be calculated from recurring contribution if not provided)',
656 'type' => CRM_Utils_Type
::T_INT
,
658 $params['contribution_recur_id'] = array(
659 'title' => 'Recurring contribution ID',
660 'type' => CRM_Utils_Type
::T_INT
,
662 $params['trxn_id'] = array(
663 'title' => 'Transaction ID',
664 'type' => CRM_Utils_Type
::T_STRING
,
666 $params['is_email_receipt'] = array(
667 'title' => 'Send email Receipt?',
668 'type' => CRM_Utils_Type
::T_BOOLEAN
,
670 $params['contribution_status_id'] = array(
671 'title' => 'Contribution Status ID',
672 'name' => 'contribution_status_id',
673 'type' => CRM_Utils_Type
::T_INT
,
674 'pseudoconstant' => array(
675 'optionGroupName' => 'contribution_status',
677 'api.required' => TRUE,
679 $params['receive_date'] = array(
680 'title' => 'Contribution Receive Date',
681 'name' => 'receive_date',
682 'type' => CRM_Utils_Type
::T_DATE
,
683 'api.default' => 'now',
685 $params['trxn_id'] = array(
686 'title' => 'Transaction ID',
688 'type' => CRM_Utils_Type
::T_STRING
,
690 $params['campaign_id'] = array(
691 'title' => 'Campaign ID',
692 'name' => 'campaign_id',
693 'type' => CRM_Utils_Type
::T_INT
,
694 'pseudoconstant' => array(
695 'table' => 'civicrm_campaign',
697 'labelColumn' => 'title',
700 $params['financial_type_id'] = array(
701 'title' => 'Financial ID (ignored if more than one line item)',
702 'name' => 'financial_type_id',
703 'type' => CRM_Utils_Type
::T_INT
,
704 'pseudoconstant' => array(
705 'table' => 'civicrm_financial_type',
707 'labelColumn' => 'name',
710 $params['payment_processor_id'] = array(
711 'description' => ts('Payment processor ID, will be loaded from contribution_recur if not provided'),
712 'title' => 'Payment processor ID',
713 'name' => 'payment_processor_id',
714 'type' => CRM_Utils_Type
::T_INT
,