From: Eileen McNaughton Date: Mon, 10 Jul 2023 00:35:02 +0000 (+1200) Subject: Stop passing result into getContributionParams to get one value from it X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f7b5d3ba19cf47040ff9c7e98265d891736619ad;p=civicrm-core.git Stop passing result into getContributionParams to get one value from it We are passing in a vague array but we care about only one value that might be in it, from one of the places this is called. We are better to simply pick the variable out in the calling function --- diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 5b28abd7af..6e22c12c86 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -171,9 +171,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr 'skipLineItem' => $params['skipLineItem'] ?? 0, ]; - if ($paymentProcessorOutcome) { - $contributionParams['payment_processor'] = $paymentProcessorOutcome['payment_processor'] ?? NULL; - } if (!empty($params["is_email_receipt"])) { $contributionParams += [ 'receipt_date' => $receiptDate, @@ -1083,9 +1080,11 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr if (isset($params['amount'])) { $contributionParams = array_merge(self::getContributionParams( $params, $financialType->id, - $result, $receiptDate, + NULL, $receiptDate, $recurringContributionID), $contributionParams ); + + $contributionParams['payment_processor'] = $result ? ($result['payment_processor'] ?? NULL) : NULL; $contributionParams['non_deductible_amount'] = self::getNonDeductibleAmount($params, $financialType, TRUE, $form); $contributionParams['skipCleanMoney'] = TRUE; // @todo this is the wrong place for this - it should be done as close to form submission