From: eileen Date: Mon, 22 Mar 2021 02:41:55 +0000 (+1300) Subject: [REF] Simplify a couple of variables X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=eb5a5dac7a403530456d0e07dce287291a6ca093;p=civicrm-core.git [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 --- 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(),