From 6c3e774c322267c8e4449006db9cc14202b7028f Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 12 Jan 2021 09:19:56 +1300 Subject: [PATCH] Set contribution_page_id from template contribution This is tested in AuthorizeNetIPNTest::testIPNPaymentRecurNoReceipt --- CRM/Contribute/BAO/Contribution.php | 2 +- CRM/Core/Payment.php | 2 +- CRM/Core/Payment/AuthorizeNetIPN.php | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 0f8285a79f..e27dba77b2 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2442,7 +2442,7 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ else { $contributionParams['financial_type_id'] = $templateContribution['financial_type_id']; } - foreach (['contact_id', 'currency', 'source', 'amount_level', 'address_id', 'on_behalf', 'source_contact_id', 'tax_amount'] as $fieldName) { + foreach (['contact_id', 'currency', 'source', 'amount_level', 'address_id', 'on_behalf', 'source_contact_id', 'tax_amount', 'contribution_page_id'] as $fieldName) { if (isset($templateContribution[$fieldName])) { $contributionParams[$fieldName] = $templateContribution[$fieldName]; } diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index d5bd619d7a..74892574f8 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -1212,7 +1212,7 @@ abstract class CRM_Core_Payment { /** * Get URL to return the browser to on success. * - * @param $qfKey + * @param string $qfKey * * @return string */ diff --git a/CRM/Core/Payment/AuthorizeNetIPN.php b/CRM/Core/Payment/AuthorizeNetIPN.php index 564a957283..0a36b3b328 100644 --- a/CRM/Core/Payment/AuthorizeNetIPN.php +++ b/CRM/Core/Payment/AuthorizeNetIPN.php @@ -84,9 +84,6 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { //load new contribution object if required. // create a contribution and then get it processed $contribution = new CRM_Contribute_BAO_Contribution(); - $contribution->contribution_page_id = $ids['contributionPage']; - $contribution->contribution_recur_id = $ids['contributionRecur']; - $contribution->receive_date = $input['receive_date']; } $input['payment_processor_id'] = $paymentProcessorID; $isFirstOrLastRecurringPayment = $this->recur($input, $contributionRecur, $contribution, $first); -- 2.25.1