From f7b5d3ba19cf47040ff9c7e98265d891736619ad Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 10 Jul 2023 12:35:02 +1200 Subject: [PATCH] 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 --- CRM/Contribute/Form/Contribution/Confirm.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 -- 2.25.1