);
//get the payment processor id as per mode.
- $params['payment_processor_id'] = $this->_params['payment_processor_id'] = $submittedValues['payment_processor_id'] = $this->_paymentProcessor['id'];
+ $this->_params['payment_processor'] = $params['payment_processor_id'] =
+ $this->_params['payment_processor_id'] = $submittedValues['payment_processor_id'] = $this->_paymentProcessor['id'];
$now = date('YmdHis');
$fields = array();
$amount = $params['prevContribution']->fee_amount;
}
$amount = $params['fee_amount'] - $amount;
+ if (!$amount) {
+ return FALSE;
+ }
$financialAccount = CRM_Contribute_PseudoConstant::financialAccountType($params['financial_type_id'], $expenseTypeId);
$params['trxnParams']['from_financial_account_id'] = $params['to_financial_account_id'];
$params['trxnParams']['to_financial_account_id'] = $financialAccount;
$input['prevContribution']->contribution_status_id == array_search('Pending', $contributionStatuses)) {
$input['payment_processor'] = $paymentProcessorId;
}
+ $input['contribution_status_id'] = array_search('Completed', $contributionStatuses);
$input['total_amount'] = $input['amount'];
$input['contribution'] = $contribution;
$input['financial_type_id'] = $contribution->financial_type_id;
$count++;
}
- if (!CRM_Utils_Array::value('is_recur', $params) && $params['total_amount'] > 0.0) {
- $contribution = new CRM_Contribute_BAO_Contribution();
- $contribution->trxn_id = CRM_Utils_Array::value('trxn_id', $result);
- if ($contribution->find(TRUE)) {
- // next create the transaction record
- $trxnParams = array(
- 'contribution_id' => $contribution->id,
- 'trxn_date' => $now,
- 'trxn_type' => 'Debit',
- 'total_amount' => $params['total_amount'],
- 'fee_amount' => CRM_Utils_Array::value('fee_amount', $result),
- 'net_amount' => CRM_Utils_Array::value('net_amount', $result, $params['total_amount']),
- 'currency' => $config->defaultCurrency,
- 'payment_processor' => $this->_paymentProcessor['payment_processor_type'],
- 'trxn_id' => CRM_Utils_Array::value('trxn_id', $result),
- );
- $trxn = CRM_Core_BAO_FinancialTrxn::create($trxnParams);
- }
- }
}
else {
$params['action'] = $this->_action;