From eb5a5dac7a403530456d0e07dce287291a6ca093 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 22 Mar 2021 15:41:55 +1300 Subject: [PATCH] [REF] Simplify a couple of variables Rather than rely on these being passed around retrieve them with a consistent function. Note tax_amount is retrieved one other place but that is fixed in https://github.com/civicrm/civicrm-core/pull/19757 Line item will be used less once https://github.com/civicrm/civicrm-core/pull/19801 is merged --- CRM/Member/Form/Membership.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index 272ea3f6dc..05d31fd420 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -1219,14 +1219,14 @@ DESC limit 1"); $paymentParams, [ 'contact_id' => $this->_contributorContactID, - 'line_item' => $lineItem, + 'line_item' => [$this->order->getPriceSetID() => $this->order->getLineItems()], 'is_test' => $this->isTest(), 'campaign_id' => $paymentParams['campaign_id'] ?? NULL, 'source' => CRM_Utils_Array::value('source', $paymentParams, CRM_Utils_Array::value('description', $paymentParams)), 'payment_instrument_id' => $this->getPaymentInstrumentID(), 'financial_type_id' => $this->getFinancialTypeID(), 'receive_date' => CRM_Utils_Time::date('YmdHis'), - 'tax_amount' => $params['tax_amount'] ?? NULL, + 'tax_amount' => $this->order->getTotalTaxAmount(), 'total_amount' => $this->order->getTotalAmount(), 'invoice_id' => $this->getInvoiceID(), 'currency' => $this->getCurrency(), -- 2.25.1