$contributionParams['payment_instrument_id'] = 1;
}
}
+ if ($paymentProcessorOutcome) {
+ $contributionParams['payment_processor'] = CRM_Utils_Array::value('payment_processor', $paymentProcessorOutcome);
+ }
if (!$pending && $paymentProcessorOutcome) {
$contributionParams += array(
'fee_amount' => CRM_Utils_Array::value('fee_amount', $paymentProcessorOutcome),
'receipt_date' => $receiptDate,
// also add financial_trxn details as part of fix for CRM-4724
'trxn_result_code' => CRM_Utils_Array::value('trxn_result_code', $paymentProcessorOutcome),
- 'payment_processor' => CRM_Utils_Array::value('payment_processor', $paymentProcessorOutcome),
);
}
// a better fix would be to set the values in the respective forms rather than require
// a function being shared by two forms to deal with their respective values
// moving it to the BAO & not taking the $form as a param would make sense here.
- if(!isset($params['is_email_receipt'])){
+ if(!isset($params['is_email_receipt']) && !empty($form->_values['is_email_receipt'])){
$params['is_email_receipt'] = CRM_Utils_Array::value( 'is_email_receipt', $form->_values );
}
$recurringContributionID = self::processRecurringContribution($form, $params, $contactID, $financialType, $online);
}
if (isset($params['amount'])) {
+ $isMonetary = NULL;
+ if (!empty($form->_values['is_monetary'])) {
+ $isMonetary = $form->_values['is_monetary'];
+ }
$contribParams = self::getContributionParams(
- $params, $contactID, $financialType->id, $online, $contributionPageId, $nonDeductibleAmount, $campaignId, $form->_values['is_monetary'], $pending, $result, $receiptDate,
+ $params, $contactID, $financialType->id, $online, $contributionPageId, $nonDeductibleAmount, $campaignId, $isMonetary, $pending, $result, $receiptDate,
$recurringContributionID, $isTest, $addressID, $contribSoftContactId, $lineItems
);
$contribution = CRM_Contribute_BAO_Contribution::add($contribParams);
// CRM-14354: For an auto-renewing membership with an additional contribution,
// if separate payments is not enabled, make sure only the membership fee recurs
- if ($form->_membershipBlock['is_separate_payment'] === '0'
+ if (!empty($form->_membershipBlock)
+ && $form->_membershipBlock['is_separate_payment'] === '0'
&& isset($params['selectMembership'])
&& $form->_values['is_allow_other_amount'] == '1'
) {