3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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'])) {
54 if (empty($params['financial_type_id'])) {
55 $params['financial_type_id'] = civicrm_api3('Contribution', 'getvalue', array(
56 'id' => $params['id'],
57 'return' => 'financial_type_id',
62 CRM_Financial_BAO_FinancialType
::getAvailableFinancialTypes($types, $op);
63 if (!in_array($params['financial_type_id'], array_keys($types))) {
64 return civicrm_api3_create_error('You do not have permission to create this contribution');
67 if (!empty($params['id']) && !empty($params['contribution_status_id'])) {
69 //throw error for invalid status change such as setting completed back to pending
70 //@todo this sort of validation belongs in the BAO not the API - if it is not an OK
71 // action it needs to be blocked there. If it is Ok through a form it needs to be OK through the api
72 CRM_Contribute_BAO_Contribution
::checkStatusValidation(NULL, $params, $error);
73 if (array_key_exists('contribution_status_id', $error)) {
74 throw new API_Exception($error['contribution_status_id']);
77 if (!empty($params['id']) && !empty($params['financial_type_id'])) {
79 CRM_Contribute_BAO_Contribution
::checkFinancialTypeChange($params['financial_type_id'], $params['id'], $error);
80 if (array_key_exists('financial_type_id', $error)) {
81 throw new API_Exception($error['financial_type_id']);
84 _civicrm_api3_contribution_create_legacy_support_45($params);
86 // Make sure tax calculation is handled via api.
87 // @todo this belongs in the BAO NOT the api.
88 $params = CRM_Contribute_BAO_Contribution
::checkTaxAmount($params);
90 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'Contribution');
94 * Adjust Metadata for Create action.
96 * The metadata is used for setting defaults, documentation & validation.
98 * @param array $params
99 * Array of parameters determined by getfields.
101 function _civicrm_api3_contribution_create_spec(&$params) {
102 $params['contact_id']['api.required'] = 1;
103 $params['total_amount']['api.required'] = 1;
104 $params['payment_instrument_id']['api.aliases'] = array('payment_instrument');
105 $params['receive_date']['api.default'] = 'now';
106 $params['payment_processor'] = array(
107 'name' => 'payment_processor',
108 'title' => 'Payment Processor ID',
109 'description' => 'ID of payment processor used for this contribution',
110 // field is called payment processor - not payment processor id but can only be one id so
111 // it seems likely someone will fix it up one day to be more consistent - lets alias it from the start
112 'api.aliases' => array('payment_processor_id'),
113 'type' => CRM_Utils_Type
::T_INT
,
115 $params['financial_type_id']['api.aliases'] = array('contribution_type_id', 'contribution_type');
116 $params['financial_type_id']['api.required'] = 1;
117 $params['note'] = array(
119 'uniqueName' => 'contribution_note',
122 'description' => 'Associated Note in the notes table',
124 $params['soft_credit_to'] = array(
125 'name' => 'soft_credit_to',
126 'title' => 'Soft Credit contact ID (legacy)',
127 'type' => CRM_Utils_Type
::T_INT
,
128 'description' => 'ID of Contact to be Soft credited to (deprecated - use contribution_soft api)',
129 'FKClassName' => 'CRM_Contact_DAO_Contact',
131 $params['honor_contact_id'] = array(
132 'name' => 'honor_contact_id',
133 'title' => 'Honoree contact ID (legacy)',
134 'type' => CRM_Utils_Type
::T_INT
,
135 'description' => 'ID of honoree contact (deprecated - use contribution_soft api)',
136 'FKClassName' => 'CRM_Contact_DAO_Contact',
138 $params['honor_type_id'] = array(
139 'name' => 'honor_type_id',
140 'title' => 'Honoree Type (legacy)',
141 'type' => CRM_Utils_Type
::T_INT
,
142 'description' => 'Type of honoree contact (deprecated - use contribution_soft api)',
143 'pseudoconstant' => TRUE,
145 // note this is a recommended option but not adding as a default to avoid
146 // creating unnecessary changes for the dev
147 $params['skipRecentView'] = array(
148 'name' => 'skipRecentView',
149 'title' => 'Skip adding to recent view',
150 'type' => CRM_Utils_Type
::T_BOOLEAN
,
151 'description' => 'Do not add to recent view (setting this improves performance)',
153 $params['skipLineItem'] = array(
154 'name' => 'skipLineItem',
155 'title' => 'Skip adding line items',
156 'type' => CRM_Utils_Type
::T_BOOLEAN
,
158 'description' => 'Do not add line items by default (if you wish to add your own)',
160 $params['batch_id'] = array(
162 'type' => CRM_Utils_Type
::T_INT
,
163 'description' => 'Batch which relevant transactions should be added to',
165 $params['refund_trxn_id'] = array(
166 'title' => 'Refund Transaction ID',
167 'type' => CRM_Utils_Type
::T_STRING
,
168 'description' => 'Transaction ID specific to the refund taking place',
173 * Support for schema changes made in 4.5.
175 * The main purpose of the API is to provide integrators a level of stability not provided by
176 * the core code or schema - this means we have to provide support for api calls (where possible)
177 * across schema changes.
179 * @param array $params
181 function _civicrm_api3_contribution_create_legacy_support_45(&$params) {
182 //legacy soft credit handling - recommended approach is chaining
183 if (!empty($params['soft_credit_to'])) {
184 $params['soft_credit'][] = array(
185 'contact_id' => $params['soft_credit_to'],
186 'amount' => $params['total_amount'],
187 'soft_credit_type_id' => CRM_Core_OptionGroup
::getDefaultValue("soft_credit_type"),
190 if (!empty($params['honor_contact_id'])) {
191 $params['soft_credit'][] = array(
192 'contact_id' => $params['honor_contact_id'],
193 'amount' => $params['total_amount'],
194 'soft_credit_type_id' => CRM_Utils_Array
::value('honor_type_id', $params, CRM_Core_OptionGroup
::getValue('soft_credit_type', 'in_honor_of', 'name')),
200 * Delete a Contribution.
202 * @param array $params
207 function civicrm_api3_contribution_delete($params) {
209 $contributionID = !empty($params['contribution_id']) ?
$params['contribution_id'] : $params['id'];
210 // First check contribution financial type
211 $financialType = CRM_Core_DAO
::getFieldValue('CRM_Contribute_DAO_Contribution', $contributionID, 'financial_type_id');
212 // Now check permissioned lineitems & permissioned contribution
213 if (CRM_Financial_BAO_FinancialType
::isACLFinancialTypeStatus()
214 && !CRM_Core_Permission
::check('delete contributions of type ' . CRM_Contribute_PseudoConstant
::financialType($financialType)) ||
215 !CRM_Financial_BAO_FinancialType
::checkPermissionedLineItems($contributionID, 'delete', FALSE)
217 return civicrm_api3_create_error('You do not have permission to delete this contribution');
219 if (CRM_Contribute_BAO_Contribution
::deleteContribution($contributionID)) {
220 return civicrm_api3_create_success(array($contributionID => 1));
223 return civicrm_api3_create_error('Could not delete contribution');
228 * Modify metadata for delete action.
230 * Legacy support for contribution_id.
232 * @param array $params
234 function _civicrm_api3_contribution_delete_spec(&$params) {
235 $params['id']['api.aliases'] = array('contribution_id');
239 * Retrieve a set of contributions.
241 * @param array $params
245 * Array of contributions, if error an array with an error id and error message
247 function civicrm_api3_contribution_get($params) {
249 $mode = CRM_Contact_BAO_Query
::MODE_CONTRIBUTE
;
250 $returnProperties = CRM_Contribute_BAO_Query
::defaultReturnProperties($mode);
252 $contributions = _civicrm_api3_get_using_query_object('Contribution', $params, array(), NULL, $mode, $returnProperties);
254 foreach ($contributions as $id => $contribution) {
255 $softContribution = CRM_Contribute_BAO_ContributionSoft
::getSoftContribution($id, TRUE);
256 $contributions[$id] = array_merge($contribution, $softContribution);
257 // format soft credit for backward compatibility
258 _civicrm_api3_format_soft_credit($contributions[$id]);
260 return civicrm_api3_create_success($contributions, $params, 'Contribution', 'get');
264 * Get number of contacts matching the supplied criteria.
266 * @param array $params
270 function civicrm_api3_contribution_getcount($params) {
271 $count = _civicrm_api3_get_using_query_object('Contribution', $params, array(), TRUE, CRM_Contact_BAO_Query
::MODE_CONTRIBUTE
);
276 * This function is used to format the soft credit for backward compatibility.
278 * As of v4.4 we support multiple soft credit, so now contribution returns array with 'soft_credit' as key
279 * but we still return first soft credit as a part of contribution array
281 * @param $contribution
283 function _civicrm_api3_format_soft_credit(&$contribution) {
284 if (!empty($contribution['soft_credit'])) {
285 $contribution['soft_credit_to'] = $contribution['soft_credit'][1]['contact_id'];
286 $contribution['soft_credit_id'] = $contribution['soft_credit'][1]['soft_credit_id'];
291 * Adjust Metadata for Get action.
293 * The metadata is used for setting defaults, documentation & validation.
295 * @param array $params
296 * Array of parameters determined by getfields.
298 function _civicrm_api3_contribution_get_spec(&$params) {
299 $params['contribution_test'] = array(
301 'type' => CRM_Utils_Type
::T_BOOLEAN
,
302 'title' => 'Get Test Contributions?',
303 'api.aliases' => array('is_test'),
306 $params['financial_type_id']['api.aliases'] = array('contribution_type_id');
307 $params['payment_instrument_id']['api.aliases'] = array('contribution_payment_instrument', 'payment_instrument');
308 $params['contact_id'] = $params['contribution_contact_id'];
309 $params['contact_id']['api.aliases'] = array('contribution_contact_id');
310 unset($params['contribution_contact_id']);
314 * Legacy handling for contribution parameters.
316 * Take the input parameter list as specified in the data model and
317 * convert it into the same format that we use in QF and BAO object.
319 * @param array $params
320 * property name/value pairs to insert in new contact.
321 * @param array $values
322 * The reformatted properties that we can use internally.
326 function _civicrm_api3_contribute_format_params($params, &$values) {
327 //legacy way of formatting from v2 api - v3 way is to define metadata & do it in the api layer
328 _civicrm_api3_filter_fields_for_bao('Contribution', $params, $values);
333 * Adjust Metadata for Transact action.
335 * The metadata is used for setting defaults, documentation & validation.
337 * @param array $params
338 * Array of parameters determined by getfields.
340 function _civicrm_api3_contribution_transact_spec(&$params) {
341 $fields = civicrm_api3('Contribution', 'getfields', array('action' => 'create'));
342 $params = array_merge($params, $fields['values']);
343 $params['receive_date']['api.default'] = 'now';
347 * Process a transaction and record it against the contact.
349 * @param array $params
353 * contribution of created or updated record (or a civicrm error)
355 function civicrm_api3_contribution_transact($params) {
356 // Set some params specific to payment processing
357 // @todo - fix this function - none of the results checked by civicrm_error would ever be an array with
359 // also trxn_id is not saved.
360 // but since there is no test it's not desirable to jump in & make the obvious changes.
361 $params['payment_processor_mode'] = empty($params['is_test']) ?
'live' : 'test';
362 $params['amount'] = $params['total_amount'];
363 if (!isset($params['net_amount'])) {
364 $params['net_amount'] = $params['amount'];
366 if (!isset($params['invoiceID']) && isset($params['invoice_id'])) {
367 $params['invoiceID'] = $params['invoice_id'];
370 // Some payment processors expect a unique invoice_id - generate one if not supplied
371 $params['invoice_id'] = CRM_Utils_Array
::value('invoice_id', $params, md5(uniqid(rand(), TRUE)));
373 $paymentProcessor = CRM_Financial_BAO_PaymentProcessor
::getPayment($params['payment_processor'], $params['payment_processor_mode']);
374 $paymentProcessor['object']->doPayment($params);
376 $params['payment_instrument_id'] = CRM_Core_DAO
::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', $paymentProcessor['payment_processor_type_id'], 'payment_type') == 1 ?
'Credit Card' : 'Debit Card';
377 return civicrm_api('Contribution', 'create', $params);
381 * Send a contribution confirmation (receipt or invoice).
383 * The appropriate online template will be used (the existence of related objects
384 * (e.g. memberships ) will affect this selection
386 * @param array $params
391 function civicrm_api3_contribution_sendconfirmation($params) {
392 $contribution = new CRM_Contribute_BAO_Contribution();
393 $contribution->id
= $params['id'];
394 if (!$contribution->find(TRUE)) {
395 throw new Exception('Contribution does not exist');
397 $input = $ids = $cvalues = array('receipt_from_email' => $params['receipt_from_email']);
398 $contribution->loadRelatedObjects($input, $ids, TRUE);
399 $contribution->composeMessageArray($input, $ids, $cvalues, FALSE, FALSE);
403 * Adjust Metadata for sendconfirmation action.
405 * The metadata is used for setting defaults, documentation & validation.
407 * @param array $params
408 * Array of parameters determined by getfields.
410 function _civicrm_api3_contribution_sendconfirmation_spec(&$params) {
411 $params['id'] = array(
413 'title' => 'Contribution ID',
414 'type' => CRM_Utils_Type
::T_INT
,
416 $params['receipt_from_email'] = array(
418 'title' => 'From Email address (string) required until someone provides a patch :-)',
419 'type' => CRM_Utils_Type
::T_STRING
,
421 $params['receipt_from_name'] = array(
422 'title' => 'From Name (string)',
423 'type' => CRM_Utils_Type
::T_STRING
,
425 $params['cc_receipt'] = array(
426 'title' => 'CC Email address (string)',
427 'type' => CRM_Utils_Type
::T_STRING
,
429 $params['bcc_receipt'] = array(
430 'title' => 'BCC Email address (string)',
431 'type' => CRM_Utils_Type
::T_STRING
,
433 $params['receipt_text'] = array(
434 'title' => 'Message (string)',
435 'type' => CRM_Utils_Type
::T_STRING
,
440 * Complete an existing (pending) transaction.
442 * This will update related entities (participant, membership, pledge etc)
443 * and take any complete actions from the contribution page (e.g. send receipt).
445 * @todo - most of this should live in the BAO layer but as we want it to be an addition
446 * to 4.3 which is already stable we should add it to the api layer & re-factor into the BAO layer later
448 * @param array $params
451 * @throws API_Exception
454 function civicrm_api3_contribution_completetransaction(&$params) {
456 $input = $ids = array();
457 if (isset($params['payment_processor_id'])) {
458 $input['payment_processor_id'] = $params['payment_processor_id'];
460 $contribution = new CRM_Contribute_BAO_Contribution();
461 $contribution->id
= $params['id'];
462 $contribution->find(TRUE);
463 if (!$contribution->id
== $params['id']) {
464 throw new API_Exception('A valid contribution ID is required', 'invalid_data');
467 if (!$contribution->loadRelatedObjects($input, $ids, TRUE)) {
468 throw new API_Exception('failed to load related objects');
470 elseif ($contribution->contribution_status_id
== CRM_Core_OptionGroup
::getValue('contribution_status', 'Completed', 'name')) {
471 throw new API_Exception(ts('Contribution already completed'), 'contribution_completed');
473 $input['trxn_id'] = !empty($params['trxn_id']) ?
$params['trxn_id'] : $contribution->trxn_id
;
474 if (!empty($params['fee_amount'])) {
475 $input['fee_amount'] = $params['fee_amount'];
477 $params = _ipn_process_transaction($params, $contribution, $input, $ids);
482 * Provide function metadata.
484 * @param array $params
486 function _civicrm_api3_contribution_completetransaction_spec(&$params) {
487 $params['id'] = array(
488 'title' => 'Contribution ID',
489 'type' => CRM_Utils_Type
::T_INT
,
490 'api.required' => TRUE,
492 $params['trxn_id'] = array(
493 'title' => 'Transaction ID',
494 'type' => CRM_Utils_Type
::T_STRING
,
496 $params['is_email_receipt'] = array(
497 'title' => 'Send email Receipt?',
498 'type' => CRM_Utils_Type
::T_BOOLEAN
,
500 $params['receipt_from_email'] = array(
501 'title' => 'Email to send receipt from.',
502 'description' => 'If not provided this will default to being based on domain mail or contribution page',
503 'type' => CRM_Utils_Type
::T_EMAIL
,
505 $params['receipt_from_name'] = array(
506 'title' => 'Name to send receipt from',
507 'description' => '. If not provided this will default to domain mail or contribution page',
508 'type' => CRM_Utils_Type
::T_STRING
,
510 $params['payment_processor_id'] = array(
511 'title' => 'Payment processor ID',
512 'description' => 'Providing this is strongly recommended, as not possible to calculate it accurately always',
513 'type' => CRM_Utils_Type
::T_INT
,
515 $params['fee_amount'] = array(
516 'title' => 'Fee charged on transaction',
517 'description' => 'If a fee has been charged then the amount',
518 'type' => CRM_Utils_Type
::T_FLOAT
,
520 $params['trxn_date'] = array(
521 'title' => 'Transaction Date',
522 'description' => 'Date this transaction occurred',
523 'type' => CRM_Utils_Type
::T_DATE
,
528 * Complete an existing (pending) transaction.
530 * This will update related entities (participant, membership, pledge etc)
531 * and take any complete actions from the contribution page (e.g. send receipt).
533 * @todo - most of this should live in the BAO layer but as we want it to be an addition
534 * to 4.3 which is already stable we should add it to the api layer & re-factor into the BAO layer later
536 * @param array $params
539 * @throws API_Exception
542 function civicrm_api3_contribution_repeattransaction(&$params) {
543 $input = $ids = array();
544 civicrm_api3_verify_one_mandatory($params, NULL, array('contribution_recur_id', 'original_contribution_id'));
545 if (empty($params['original_contribution_id'])) {
546 $params['original_contribution_id'] = civicrm_api3('contribution', 'getvalue', array(
548 'contribution_recur_id' => $params['contribution_recur_id'],
549 'options' => array('limit' => 1, 'sort' => 'id DESC'),
552 $contribution = new CRM_Contribute_BAO_Contribution();
553 $contribution->id
= $params['original_contribution_id'];
554 if (!$contribution->find(TRUE)) {
555 throw new API_Exception(
556 'A valid original contribution ID is required', 'invalid_data');
558 $original_contribution = clone $contribution;
560 if (!$contribution->loadRelatedObjects($input, $ids, TRUE)) {
561 throw new API_Exception('failed to load related objects');
564 unset($contribution->id
, $contribution->receive_date
, $contribution->invoice_id
);
565 $contribution->contribution_status_id
= $params['contribution_status_id'];
566 $contribution->receive_date
= $params['receive_date'];
568 $passThroughParams = array('trxn_id', 'total_amount', 'campaign_id', 'fee_amount', 'financial_type_id');
569 $input = array_intersect_key($params, array_fill_keys($passThroughParams, NULL));
571 $params = _ipn_process_transaction($params, $contribution, $input, $ids, $original_contribution);
573 catch(Exception
$e) {
574 throw new API_Exception('failed to load related objects' . $e->getMessage() . "\n" . $e->getTraceAsString());
579 * Calls IPN complete transaction for completing or repeating a transaction.
581 * The IPN function is overloaded with two purposes - this is simply a wrapper for that
582 * when separating them in the api layer.
584 * @param array $params
585 * @param CRM_Contribute_BAO_Contribution $contribution
586 * @param array $input
590 * @param CRM_Contribute_BAO_Contribution $firstContribution
594 function _ipn_process_transaction(&$params, $contribution, $input, $ids, $firstContribution = NULL) {
595 $objects = $contribution->_relatedObjects
;
596 $objects['contribution'] = &$contribution;
598 if ($firstContribution) {
599 $objects['first_contribution'] = $firstContribution;
601 $input['component'] = $contribution->_component
;
602 $input['is_test'] = $contribution->is_test
;
603 $input['amount'] = empty($input['total_amount']) ?
$contribution->total_amount
: $input['total_amount'];
605 if (isset($params['is_email_receipt'])) {
606 $input['is_email_receipt'] = $params['is_email_receipt'];
608 if (!empty($params['trxn_date'])) {
609 $input['trxn_date'] = $params['trxn_date'];
611 if (empty($contribution->contribution_page_id
)) {
612 static $domainFromName;
613 static $domainFromEmail;
614 if (empty($domainFromEmail) && (empty($params['receipt_from_name']) ||
empty($params['receipt_from_email']))) {
615 list($domainFromName, $domainFromEmail) = CRM_Core_BAO_Domain
::getNameAndEmail(TRUE);
617 $input['receipt_from_name'] = CRM_Utils_Array
::value('receipt_from_name', $params, $domainFromName);
618 $input['receipt_from_email'] = CRM_Utils_Array
::value('receipt_from_email', $params, $domainFromEmail);
620 $transaction = new CRM_Core_Transaction();
621 CRM_Contribute_BAO_Contribution
::completeOrder($input, $ids, $objects, $transaction, !empty($contribution->contribution_recur_id
), $contribution,
627 * Provide function metadata.
629 * @param array $params
631 function _civicrm_api3_contribution_repeattransaction_spec(&$params) {
632 $params['original_contribution_id'] = array(
633 'title' => 'Original Contribution ID',
634 'description' => 'Contribution ID to copy (will be calculated from recurring contribution if not provided)',
635 'type' => CRM_Utils_Type
::T_INT
,
637 $params['contribution_recur_id'] = array(
638 'title' => 'Recurring contribution ID',
639 'type' => CRM_Utils_Type
::T_INT
,
641 $params['trxn_id'] = array(
642 'title' => 'Transaction ID',
643 'type' => CRM_Utils_Type
::T_STRING
,
645 $params['is_email_receipt'] = array(
646 'title' => 'Send email Receipt?',
647 'type' => CRM_Utils_Type
::T_BOOLEAN
,
649 $params['contribution_status_id'] = array(
650 'title' => 'Contribution Status ID',
651 'name' => 'contribution_status_id',
652 'type' => CRM_Utils_Type
::T_INT
,
653 'pseudoconstant' => array(
654 'optionGroupName' => 'contribution_status',
656 'api.required' => TRUE,
658 $params['receive_date'] = array(
659 'title' => 'Contribution Receive Date',
660 'name' => 'receive_date',
661 'type' => CRM_Utils_Type
::T_DATE
,
662 'api.default' => 'now',
664 $params['trxn_id'] = array(
665 'title' => 'Transaction ID',
667 'type' => CRM_Utils_Type
::T_STRING
,
669 $params['campaign_id'] = array(
670 'title' => 'Campaign ID',
671 'name' => 'campaign_id',
672 'type' => CRM_Utils_Type
::T_INT
,
673 'pseudoconstant' => array(
674 'table' => 'civicrm_campaign',
676 'labelColumn' => 'title',
679 $params['financial_type_id'] = array(
680 'title' => 'Financial ID (ignored if more than one line item)',
681 'name' => 'financial_type_id',
682 'type' => CRM_Utils_Type
::T_INT
,
683 'pseudoconstant' => array(
684 'table' => 'civicrm_financial_type',
686 'labelColumn' => 'name',
689 $params['payment_processor_id'] = array(
690 'description' => ts('Payment processor ID, will be loaded from contribution_recur if not provided'),
691 'title' => 'Payment processor ID',
692 'name' => 'payment_processor_id',
693 'type' => CRM_Utils_Type
::T_INT
,