Fatal error fix
[civicrm-core.git] / CRM / Contribute / Form / AbstractEditPayment.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
39de6fd5 4 | CiviCRM version 4.6 |
6a488035 5 +--------------------------------------------------------------------+
e7112fa7 6 | Copyright CiviCRM LLC (c) 2004-2015 |
6a488035
TO
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
14 | CiviCRM is distributed in the hope that it will be usefusul, 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. |
18 | |
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 +--------------------------------------------------------------------+
d25dd0ee 26 */
6a488035
TO
27
28/**
29 *
30 * @package CRM
e7112fa7 31 * @copyright CiviCRM LLC (c) 2004-2015
6a488035
TO
32 * $Id$
33 *
34 */
35
36/**
37 * This class generates form components for processing a contribution
38 *
39 */
5b7c9ebc 40class CRM_Contribute_Form_AbstractEditPayment extends CRM_Contact_Form_Task {
6a488035
TO
41 public $_mode;
42
43 public $_action;
44
45 public $_bltID;
46
47 public $_fields;
48
a6513ad5
EM
49 /**
50 * @var array current payment processor including a copy of the object in 'object' key
51 */
6a488035
TO
52 public $_paymentProcessor;
53 public $_recurPaymentProcessors;
54
dc913073 55 /**
100fef9d 56 * Array of processor options in the format id => array($id => $label)
dc913073
EM
57 * WARNING it appears that the format used to differ to this and there are places in the code that
58 * expect the old format. $this->_paymentProcessors provides the additional data which this
59 * array seems to have provided in the past
60 * @var array
61 */
6a488035
TO
62 public $_processors;
63
64 /**
100fef9d 65 * Available payment processors with full details including the key 'object' indexed by their id
dc913073
EM
66 * @var array
67 */
68 protected $_paymentProcessors = array();
69 /**
fe482240 70 * The id of the contribution that we are processing.
6a488035
TO
71 *
72 * @var int
6a488035
TO
73 */
74 public $_id;
75
76 /**
fe482240 77 * The id of the premium that we are proceessing.
6a488035
TO
78 *
79 * @var int
6a488035
TO
80 */
81 public $_premiumID = NULL;
4691b077
EM
82
83 /**
84 * @var CRM_Contribute_DAO_ContributionProduct
85 */
6a488035
TO
86 public $_productDAO = NULL;
87
88 /**
100fef9d 89 * The id of the note
6a488035
TO
90 *
91 * @var int
6a488035
TO
92 */
93 public $_noteID;
94
95 /**
100fef9d 96 * The id of the contact associated with this contribution
6a488035
TO
97 *
98 * @var int
6a488035
TO
99 */
100 public $_contactID;
101
102 /**
100fef9d 103 * The id of the pledge payment that we are processing
6a488035
TO
104 *
105 * @var int
6a488035
TO
106 */
107 public $_ppID;
108
109 /**
100fef9d 110 * The id of the pledge that we are processing
6a488035
TO
111 *
112 * @var int
6a488035
TO
113 */
114 public $_pledgeID;
115
116 /**
100fef9d 117 * Is this contribution associated with an online
6a488035
TO
118 * financial transaction
119 *
120 * @var boolean
6a488035
TO
121 */
122 public $_online = FALSE;
123
124 /**
125 * Stores all product option
126 *
127 * @var array
6a488035
TO
128 */
129 public $_options;
130
131 /**
100fef9d 132 * Stores the honor id
6a488035
TO
133 *
134 * @var int
6a488035
TO
135 */
136 public $_honorID = NULL;
137
138 /**
dde5a0ef 139 * Store the financial Type ID
6a488035
TO
140 *
141 * @var array
142 */
143 public $_contributionType;
144
145 /**
146 * The contribution values if an existing contribution
147 */
148 public $_values;
149
150 /**
151 * The pledge values if this contribution is associated with pledge
152 */
153 public $_pledgeValues;
154
155 public $_contributeMode = 'direct';
156
157 public $_context;
158
159 public $_compId;
160
d424ffde 161 /**
6a488035
TO
162 * Store the line items if price set used.
163 */
164 public $_lineItems;
165
0be0b79d
EM
166 /**
167 * Is this a backoffice form
168 * (this will affect whether paypal express code is displayed)
169 * @var bool
170 */
171 public $isBackOffice = TRUE;
172
6a488035 173 protected $_formType;
dde5a0ef
EM
174
175 /**
176 * @var mystery variable screaming out for documentation
177 */
6a488035
TO
178 protected $_cdType;
179
dde5a0ef 180 /**
100fef9d 181 * Array of fields to display on billingBlock.tpl - this is not fully implemented but basically intent is the panes/fieldsets on this page should
dde5a0ef
EM
182 * be all in this array in order like
183 * 'credit_card' => array('credit_card_number' ...
184 * 'billing_details' => array('first_name' ...
185 *
186 * such that both the fields and the order can be more easily altered by payment processors & other extensions
187 * @var array
188 */
189 public $billingFieldSets = array();
190
186c9c17 191 /**
100fef9d 192 * @param int $id
186c9c17 193 */
d5397f2f
PJ
194 public function showRecordLinkMesssage($id) {
195 $statusId = CRM_Core_DAO::getFieldValue('CRM_Contribute_BAO_Contribution', $id, 'contribution_status_id');
196 if (CRM_Contribute_PseudoConstant::contributionStatus($statusId, 'name') == 'Partially paid') {
197 if ($pid = CRM_Core_DAO::getFieldValue('CRM_Event_BAO_ParticipantPayment', $id, 'participant_id', 'contribution_id')) {
198 $recordPaymentLink = CRM_Utils_System::url('civicrm/payment',
199 "reset=1&id={$pid}&cid={$this->_contactID}&action=add&component=event"
200 );
201 CRM_Core_Session::setStatus(ts('Please use the <a href="%1">Record Payment</a> form if you have received an additional payment for this Partially paid contribution record.', array(1 => $recordPaymentLink)), ts('Notice'), 'alert');
202 }
203 }
204 }
205
186c9c17 206 /**
100fef9d 207 * @param int $id
186c9c17
EM
208 * @param $values
209 */
6a488035
TO
210 public function buildValuesAndAssignOnline_Note_Type($id, &$values) {
211 $ids = array();
212 $params = array('id' => $id);
213 CRM_Contribute_BAO_Contribution::getValues($params, $values, $ids);
214
215 //Check if this is an online transaction (financial_trxn.payment_processor_id NOT NULL)
216 $this->_online = FALSE;
217 $fids = CRM_Core_BAO_FinancialTrxn::getFinancialTrxnId($id);
a7488080 218 if (!empty($fids['financialTrxnId'])) {
6a488035
TO
219 $this->_online = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialTrxn', $fids['financialTrxnId'], 'payment_processor_id');
220 }
eea16664 221
6a488035
TO
222 // Also don't allow user to update some fields for recurring contributions.
223 if (!$this->_online) {
224 $this->_online = CRM_Utils_Array::value('contribution_recur_id', $values);
225 }
eea16664 226
6a488035
TO
227 $this->assign('isOnline', $this->_online ? TRUE : FALSE);
228
6a488035
TO
229 //to get note id
230 $daoNote = new CRM_Core_BAO_Note();
231 $daoNote->entity_table = 'civicrm_contribution';
232 $daoNote->entity_id = $id;
233 if ($daoNote->find(TRUE)) {
234 $this->_noteID = $daoNote->id;
235 $values['note'] = $daoNote->note;
236 }
237 $this->_contributionType = $values['financial_type_id'];
6a488035
TO
238 }
239
240 /**
014c4014
TO
241 * @param string $type
242 * Eg 'Contribution'.
6a488035
TO
243 * @param string $subType
244 * @param int $entityId
245 */
246 public function applyCustomData($type, $subType, $entityId) {
247 $this->set('type', $type);
248 $this->set('subType', $subType);
249 $this->set('entityId', $entityId);
250
251 CRM_Custom_Form_CustomData::preProcess($this, NULL, $subType, 1, $type, $entityId);
252 CRM_Custom_Form_CustomData::buildQuickForm($this);
253 CRM_Custom_Form_CustomData::setDefaultValues($this);
254 }
255
4691b077 256 /**
100fef9d 257 * @param int $id
4691b077
EM
258 * @todo - this function is a long way, non standard of saying $dao = new CRM_Contribute_DAO_ContributionProduct(); $dao->id = $id; $dao->find();
259 */
6ea503d4 260 public function assignPremiumProduct($id) {
6a488035
TO
261 $sql = "
262SELECT *
263FROM civicrm_contribution_product
264WHERE contribution_id = {$id}
265";
266 $dao = CRM_Core_DAO::executeQuery($sql,
267 CRM_Core_DAO::$_nullArray
268 );
269 if ($dao->fetch()) {
270 $this->_premiumID = $dao->id;
271 $this->_productDAO = $dao;
272 }
273 $dao->free();
274 }
275
276 /**
277 * This function process contribution related objects.
03110609 278 *
014c4014
TO
279 * @param int $contributionId
280 * @param int $statusId
281 * @param int|null $previousStatusId
03110609
EM
282 *
283 * @return null|string
6a488035 284 */
35874a67 285 protected function updateRelatedComponent($contributionId, $statusId, $previousStatusId = NULL, $receiveDate = NULL) {
6a488035
TO
286 $statusMsg = NULL;
287 if (!$contributionId || !$statusId) {
288 return $statusMsg;
289 }
290
291 $params = array(
292 'contribution_id' => $contributionId,
293 'contribution_status_id' => $statusId,
294 'previous_contribution_status_id' => $previousStatusId,
35874a67 295 'receive_date' => $receiveDate,
6a488035
TO
296 );
297
298 $updateResult = CRM_Contribute_BAO_Contribution::transitionComponents($params);
299
300 if (!is_array($updateResult) ||
301 !($updatedComponents = CRM_Utils_Array::value('updatedComponents', $updateResult)) ||
302 !is_array($updatedComponents) ||
303 empty($updatedComponents)
304 ) {
305 return $statusMsg;
306 }
307
308 // get the user display name.
309 $sql = "
310 SELECT display_name as displayName
311 FROM civicrm_contact
312LEFT JOIN civicrm_contribution on (civicrm_contribution.contact_id = civicrm_contact.id )
313 WHERE civicrm_contribution.id = {$contributionId}";
314 $userDisplayName = CRM_Core_DAO::singleValueQuery($sql);
315
316 // get the status message for user.
317 foreach ($updatedComponents as $componentName => $updatedStatusId) {
318
319 if ($componentName == 'CiviMember') {
320 $updatedStatusName = CRM_Utils_Array::value($updatedStatusId,
321 CRM_Member_PseudoConstant::membershipStatus()
322 );
323 if ($updatedStatusName == 'Cancelled') {
324 $statusMsg .= "<br />" . ts("Membership for %1 has been Cancelled.", array(1 => $userDisplayName));
325 }
326 elseif ($updatedStatusName == 'Expired') {
327 $statusMsg .= "<br />" . ts("Membership for %1 has been Expired.", array(1 => $userDisplayName));
328 }
d008a264 329 else {
13299a2b
JM
330 $endDate = CRM_Utils_Array::value('membership_end_date', $updateResult);
331 if ($endDate) {
d008a264 332 $statusMsg .= "<br />" . ts("Membership for %1 has been updated. The membership End Date is %2.",
353ffa53
TO
333 array(
334 1 => $userDisplayName,
335 2 => $endDate,
336 )
337 );
d008a264 338 }
6a488035
TO
339 }
340 }
341
342 if ($componentName == 'CiviEvent') {
343 $updatedStatusName = CRM_Utils_Array::value($updatedStatusId,
344 CRM_Event_PseudoConstant::participantStatus()
345 );
346 if ($updatedStatusName == 'Cancelled') {
347 $statusMsg .= "<br />" . ts("Event Registration for %1 has been Cancelled.", array(1 => $userDisplayName));
348 }
349 elseif ($updatedStatusName == 'Registered') {
350 $statusMsg .= "<br />" . ts("Event Registration for %1 has been updated.", array(1 => $userDisplayName));
351 }
352 }
353
354 if ($componentName == 'CiviPledge') {
355 $updatedStatusName = CRM_Utils_Array::value($updatedStatusId,
356 CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name')
357 );
358 if ($updatedStatusName == 'Cancelled') {
359 $statusMsg .= "<br />" . ts("Pledge Payment for %1 has been Cancelled.", array(1 => $userDisplayName));
360 }
361 elseif ($updatedStatusName == 'Failed') {
362 $statusMsg .= "<br />" . ts("Pledge Payment for %1 has been Failed.", array(1 => $userDisplayName));
363 }
364 elseif ($updatedStatusName == 'Completed') {
365 $statusMsg .= "<br />" . ts("Pledge Payment for %1 has been updated.", array(1 => $userDisplayName));
366 }
367 }
368 }
369
370 return $statusMsg;
371 }
372
373 /**
a6c01b45 374 * @return array
16b10e64 375 * Array of valid processors. The array resembles the DB table but also has 'object' as a key
fbcb6fba
EM
376 * @throws Exception
377 */
378 public function getValidProcessors() {
fbcb6fba
EM
379 $defaultID = NULL;
380 $capabilities = array('BackOffice');
52767de0
EM
381 if ($this->_mode) {
382 $capabilities[] = (ucfirst($this->_mode) . 'Mode');
fbcb6fba
EM
383 }
384 $processors = CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors($capabilities);
44b6505d
EM
385 return $processors;
386
6a488035
TO
387 }
388
389 /**
fe482240 390 * Assign billing type id to bltID.
6a488035 391 *
44b6505d 392 * @throws CRM_Core_Exception
6a488035
TO
393 * @return void
394 */
395 public function assignBillingType() {
180409a4 396 $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate');
6a488035
TO
397 $this->_bltID = array_search('Billing', $locationTypes);
398 if (!$this->_bltID) {
44b6505d 399 throw new CRM_Core_Exception(ts('Please set a location type of %1', array(1 => 'Billing')));
6a488035
TO
400 }
401 $this->set('bltID', $this->_bltID);
402 $this->assign('bltID', $this->_bltID);
403 }
404
405 /**
406 * Assign $this->processors, $this->recurPaymentProcessors, and related Smarty variables
407 */
408 public function assignProcessors() {
409 //ensure that processor has a valid config
410 //only valid processors get display to user
44b6505d 411
6a488035 412 if ($this->_mode) {
52767de0 413 $this->assign('processorSupportsFutureStartDate', CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting(array('supportsFutureRecurStartDate')));
dc913073
EM
414 $this->_paymentProcessors = $this->getValidProcessors();
415 if (!isset($this->_paymentProcessor['id'])) {
416 // if the payment processor isn't set yet (as indicated by the presence of an id,) we'll grab the first one which should be the default
417 $this->_paymentProcessor = reset($this->_paymentProcessors);
418 }
419 if (empty($this->_paymentProcessors)) {
44b6505d
EM
420 throw new CRM_Core_Exception(ts('You will need to configure the %1 settings for your Payment Processor before you can submit a credit card transactions.', array(1 => $this->_mode)));
421 }
353ffa53 422 $this->_processors = array();
dc913073 423 foreach ($this->_paymentProcessors as $id => $processor) {
44b6505d 424 $this->_processors[$id] = ts($processor['name']);
a5c78dea
EM
425 if (!empty($processor['description'])) {
426 $this->_processors[$id] .= ' : ' . ts($processor['description']);
427 }
44b6505d 428 }
6a488035 429 //get the valid recurring processors.
239b0928 430 $test = strtolower($this->_mode) == 'test' ? TRUE : FALSE;
dd660b68 431 $recurring = CRM_Core_PseudoConstant::paymentProcessor(FALSE, $test, 'is_recur = 1');
6a488035
TO
432 $this->_recurPaymentProcessors = array_intersect_assoc($this->_processors, $recurring);
433 }
434 $this->assign('recurringPaymentProcessorIds',
435 empty($this->_recurPaymentProcessors) ? '' : implode(',', array_keys($this->_recurPaymentProcessors))
436 );
437
438 // this required to show billing block
03110609 439 // @todo remove this assignment the billing block is now designed to be always included but will not show fieldsets unless those sets of fields are assigned
44b6505d 440 $this->assign_by_ref('paymentProcessor', $processor);
6a488035
TO
441 }
442
186c9c17 443 /**
6ea503d4
TO
444 * Get current currency from DB or use default currency.
445 *
186c9c17
EM
446 * @param $submittedValues
447 *
448 * @return mixed
449 */
6ea503d4 450 public function getCurrency($submittedValues) {
6a488035
TO
451 $config = CRM_Core_Config::singleton();
452
453 $currentCurrency = CRM_Utils_Array::value('currency',
454 $this->_values,
455 $config->defaultCurrency
456 );
457
458 // use submitted currency if present else use current currency
459 $result = CRM_Utils_Array::value('currency',
460 $submittedValues,
461 $currentCurrency
462 );
463 return $result;
464 }
465
186c9c17 466 /**
100fef9d 467 * @param int $financialTypeId
186c9c17
EM
468 *
469 * @return array
470 */
6a488035
TO
471 public function getFinancialAccounts($financialTypeId) {
472 $financialAccounts = array();
473 CRM_Core_PseudoConstant::populate($financialAccounts,
474 'CRM_Financial_DAO_EntityFinancialAccount',
475 $all = TRUE,
476 $retrieve = 'financial_account_id',
477 $filter = NULL,
478 " entity_id = {$financialTypeId} ", NULL, 'account_relationship');
479 return $financialAccounts;
480 }
481
186c9c17 482 /**
100fef9d
CW
483 * @param int $financialTypeId
484 * @param int $relationTypeId
186c9c17
EM
485 *
486 * @return mixed
487 */
6a488035
TO
488 public function getFinancialAccount($financialTypeId, $relationTypeId) {
489 $financialAccounts = $this->getFinancialAccounts($financialTypeId);
490 return CRM_Utils_Array::value($relationTypeId, $financialAccounts);
491 }
492
493 public function preProcessPledge() {
494 //get the payment values associated with given pledge payment id OR check for payments due.
495 $this->_pledgeValues = array();
496 if ($this->_ppID) {
497 $payParams = array('id' => $this->_ppID);
498
499 CRM_Pledge_BAO_PledgePayment::retrieve($payParams, $this->_pledgeValues['pledgePayment']);
500 $this->_pledgeID = CRM_Utils_Array::value('pledge_id', $this->_pledgeValues['pledgePayment']);
501 $paymentStatusID = CRM_Utils_Array::value('status_id', $this->_pledgeValues['pledgePayment']);
502 $this->_id = CRM_Utils_Array::value('contribution_id', $this->_pledgeValues['pledgePayment']);
503
504 //get all status
505 $allStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
506 if (!($paymentStatusID == array_search('Pending', $allStatus) || $paymentStatusID == array_search('Overdue', $allStatus))) {
507 CRM_Core_Error::fatal(ts("Pledge payment status should be 'Pending' or 'Overdue'."));
508 }
509
510 //get the pledge values associated with given pledge payment.
511
512 $ids = array();
513 $pledgeParams = array('id' => $this->_pledgeID);
514 CRM_Pledge_BAO_Pledge::getValues($pledgeParams, $this->_pledgeValues, $ids);
515 $this->assign('ppID', $this->_ppID);
516 }
517 else {
518 // Not making a pledge payment, so if adding a new contribution we should check if pledge payment(s) are due for this contact so we can alert the user. CRM-5206
519 if (isset($this->_contactID)) {
520 $contactPledges = CRM_Pledge_BAO_Pledge::getContactPledges($this->_contactID);
521
522 if (!empty($contactPledges)) {
523 $payments = $paymentsDue = NULL;
524 $multipleDue = FALSE;
525 foreach ($contactPledges as $key => $pledgeId) {
526 $payments = CRM_Pledge_BAO_PledgePayment::getOldestPledgePayment($pledgeId);
527 if ($payments) {
528 if ($paymentsDue) {
529 $multipleDue = TRUE;
530 break;
531 }
532 else {
533 $paymentsDue = $payments;
534 }
535 }
536 }
537 if ($multipleDue) {
538 // Show link to pledge tab since more than one pledge has a payment due
539 $pledgeTab = CRM_Utils_System::url('civicrm/contact/view',
540 "reset=1&force=1&cid={$this->_contactID}&selectedChild=pledge"
541 );
542 CRM_Core_Session::setStatus(ts('This contact has pending or overdue pledge payments. <a href="%1">Click here to view their Pledges tab</a> and verify whether this contribution should be applied as a pledge payment.', array(1 => $pledgeTab)), ts('Notice'), 'alert');
543 }
544 elseif ($paymentsDue) {
545 // Show user link to oldest Pending or Overdue pledge payment
546 $ppAmountDue = CRM_Utils_Money::format($payments['amount'], $payments['currency']);
547 $ppSchedDate = CRM_Utils_Date::customFormat(CRM_Core_DAO::getFieldValue('CRM_Pledge_DAO_PledgePayment', $payments['id'], 'scheduled_date'));
548 if ($this->_mode) {
549 $ppUrl = CRM_Utils_System::url('civicrm/contact/view/contribution',
550 "reset=1&action=add&cid={$this->_contactID}&ppid={$payments['id']}&context=pledge&mode=live"
551 );
552 }
553 else {
554 $ppUrl = CRM_Utils_System::url('civicrm/contact/view/contribution',
555 "reset=1&action=add&cid={$this->_contactID}&ppid={$payments['id']}&context=pledge"
556 );
557 }
558 CRM_Core_Session::setStatus(ts('This contact has a pending or overdue pledge payment of %2 which is scheduled for %3. <a href="%1">Click here to enter a pledge payment</a>.', array(
559 1 => $ppUrl,
560 2 => $ppAmountDue,
21dfd5f5 561 3 => $ppSchedDate,
6a488035
TO
562 )), ts('Notice'), 'alert');
563 }
564 }
565 }
566 }
567 }
568
186c9c17
EM
569 /**
570 * @param $submittedValues
571 *
572 * @return mixed
573 */
6a488035
TO
574 public function unsetCreditCardFields($submittedValues) {
575 //Offline Contribution.
576 $unsetParams = array(
577 'payment_processor_id',
578 "email-{$this->_bltID}",
579 'hidden_buildCreditCard',
580 'hidden_buildDirectDebit',
581 'billing_first_name',
582 'billing_middle_name',
583 'billing_last_name',
584 'street_address-5',
585 "city-{$this->_bltID}",
586 "state_province_id-{$this->_bltID}",
587 "postal_code-{$this->_bltID}",
588 "country_id-{$this->_bltID}",
589 'credit_card_number',
590 'cvv2',
591 'credit_card_exp_date',
592 'credit_card_type',
593 );
594 foreach ($unsetParams as $key) {
595 if (isset($submittedValues[$key])) {
596 unset($submittedValues[$key]);
597 }
598 }
599 return $submittedValues;
600 }
601
cc984198 602 /**
100fef9d 603 * Common block for setting up the parts of a form that relate to credit / debit card
cc984198
EM
604 * @throws Exception
605 */
606 protected function assignPaymentRelatedVariables() {
607 try {
99efbbf8
EM
608 if ($this->_contactID) {
609 list($this->userDisplayName, $this->userEmail) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID);
610 $this->assign('displayName', $this->userDisplayName);
611 }
cc984198
EM
612 if ($this->_mode) {
613 $this->assignProcessors();
cc984198
EM
614
615 $this->assignBillingType();
616
617 $this->_fields = array();
618 CRM_Core_Payment_Form::setPaymentFieldsByProcessor($this, $this->_paymentProcessor);
619 }
620 }
621 catch (CRM_Core_Exception $e) {
622 CRM_Core_Error::fatal($e->getMessage());
623 }
624 }
96025800 625
6a488035 626}