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
450 * @throws \API_Exception
451 * @throws \CRM_Core_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 return _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->receive_date
= $params['receive_date'];
567 $passThroughParams = array(
573 'contribution_status_id',
575 $input = array_intersect_key($params, array_fill_keys($passThroughParams, NULL));
577 return _ipn_process_transaction($params, $contribution, $input, $ids, $original_contribution);
579 catch(Exception
$e) {
580 throw new API_Exception('failed to load related objects' . $e->getMessage() . "\n" . $e->getTraceAsString());
585 * Calls IPN complete transaction for completing or repeating a transaction.
587 * The IPN function is overloaded with two purposes - this is simply a wrapper for that
588 * when separating them in the api layer.
590 * @param array $params
591 * @param CRM_Contribute_BAO_Contribution $contribution
592 * @param array $input
596 * @param CRM_Contribute_BAO_Contribution $firstContribution
600 function _ipn_process_transaction(&$params, $contribution, $input, $ids, $firstContribution = NULL) {
601 $objects = $contribution->_relatedObjects
;
602 $objects['contribution'] = &$contribution;
604 if ($firstContribution) {
605 $objects['first_contribution'] = $firstContribution;
607 $input['component'] = $contribution->_component
;
608 $input['is_test'] = $contribution->is_test
;
609 $input['amount'] = empty($input['total_amount']) ?
$contribution->total_amount
: $input['total_amount'];
611 if (isset($params['is_email_receipt'])) {
612 $input['is_email_receipt'] = $params['is_email_receipt'];
614 if (!empty($params['trxn_date'])) {
615 $input['trxn_date'] = $params['trxn_date'];
617 if (empty($contribution->contribution_page_id
)) {
618 static $domainFromName;
619 static $domainFromEmail;
620 if (empty($domainFromEmail) && (empty($params['receipt_from_name']) ||
empty($params['receipt_from_email']))) {
621 list($domainFromName, $domainFromEmail) = CRM_Core_BAO_Domain
::getNameAndEmail(TRUE);
623 $input['receipt_from_name'] = CRM_Utils_Array
::value('receipt_from_name', $params, $domainFromName);
624 $input['receipt_from_email'] = CRM_Utils_Array
::value('receipt_from_email', $params, $domainFromEmail);
626 $transaction = new CRM_Core_Transaction();
627 return CRM_Contribute_BAO_Contribution
::completeOrder($input, $ids, $objects, $transaction, !empty
628 ($contribution->contribution_recur_id
), $contribution,
633 * Provide function metadata.
635 * @param array $params
637 function _civicrm_api3_contribution_repeattransaction_spec(&$params) {
638 $params['original_contribution_id'] = array(
639 'title' => 'Original Contribution ID',
640 'description' => 'Contribution ID to copy (will be calculated from recurring contribution if not provided)',
641 'type' => CRM_Utils_Type
::T_INT
,
643 $params['contribution_recur_id'] = array(
644 'title' => 'Recurring contribution ID',
645 'type' => CRM_Utils_Type
::T_INT
,
647 $params['trxn_id'] = array(
648 'title' => 'Transaction ID',
649 'type' => CRM_Utils_Type
::T_STRING
,
651 $params['is_email_receipt'] = array(
652 'title' => 'Send email Receipt?',
653 'type' => CRM_Utils_Type
::T_BOOLEAN
,
655 $params['contribution_status_id'] = array(
656 'title' => 'Contribution Status ID',
657 'name' => 'contribution_status_id',
658 'type' => CRM_Utils_Type
::T_INT
,
659 'pseudoconstant' => array(
660 'optionGroupName' => 'contribution_status',
662 'api.required' => TRUE,
664 $params['receive_date'] = array(
665 'title' => 'Contribution Receive Date',
666 'name' => 'receive_date',
667 'type' => CRM_Utils_Type
::T_DATE
,
668 'api.default' => 'now',
670 $params['trxn_id'] = array(
671 'title' => 'Transaction ID',
673 'type' => CRM_Utils_Type
::T_STRING
,
675 $params['campaign_id'] = array(
676 'title' => 'Campaign ID',
677 'name' => 'campaign_id',
678 'type' => CRM_Utils_Type
::T_INT
,
679 'pseudoconstant' => array(
680 'table' => 'civicrm_campaign',
682 'labelColumn' => 'title',
685 $params['financial_type_id'] = array(
686 'title' => 'Financial ID (ignored if more than one line item)',
687 'name' => 'financial_type_id',
688 'type' => CRM_Utils_Type
::T_INT
,
689 'pseudoconstant' => array(
690 'table' => 'civicrm_financial_type',
692 'labelColumn' => 'name',
695 $params['payment_processor_id'] = array(
696 'description' => ts('Payment processor ID, will be loaded from contribution_recur if not provided'),
697 'title' => 'Payment processor ID',
698 'name' => 'payment_processor_id',
699 'type' => CRM_Utils_Type
::T_INT
,