- if ($result) {
- $this->_params = array_merge($this->_params, $result);
- //assign amount to template if payment was successful
- $this->assign('amount', $params['total_amount']);
- }
-
- // if the payment processor returns a payment_status_id -we assume this
- // applies to the whole contribution.
- // At this stage this form is not processing separate payments.
- if (isset($result['payment_status_id'])) {
- // CRM-16737 $result['contribution_status_id'] is deprecated in favour
- // of payment_status_id as the payment processor only knows whether the payment is complete
- // not whether payment completes the contribution
- $params['contribution_status_id'] = $params['payment_status_id'];
- }
- // do what used to happen previously
- else {
- $params['contribution_status_id'] = !empty($paymentParams['is_recur']) ? 2 : 1;
- }
- if ($params['contribution_status_id'] != array_search('Completed', $allContributionStatus)) {