Skip to content
Snippets Groups Projects
Unverified Commit af5aecaa authored by DaveD's avatar DaveD Committed by GitHub
Browse files

Merge pull request #25426 from seamuslee001/php82_payment_insturment_contribution

[REF][PHP8.2] Fix Dynamic property payment instrument id on back offi…
parents d1811294 095cec7b
Branches
Tags
No related merge requests found
......@@ -707,7 +707,7 @@ WHERE contribution_id = {$id}
*
* @throws \CRM_Core_Exception
*/
protected function getDefaultPaymentInstrumentId() {
protected function getDefaultPaymentInstrumentId(): int {
$paymentInstrumentID = CRM_Utils_Request::retrieve('payment_instrument_id', 'Integer');
return (int) ($paymentInstrumentID ?? $this->_paymentProcessor['payment_instrument_id']);
}
......
......@@ -208,6 +208,14 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
*/
protected $previousContributionStatus;
/**
* Payment Instrument ID
*
* @var int
*/
public $payment_instrument_id;
/**
* Explicitly declare the form context.
*/
......@@ -590,7 +598,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
$paneNames[ts('Premium Information')] = 'Premium';
}
$this->payment_instrument_id = CRM_Utils_Array::value('payment_instrument_id', $defaults, $this->getDefaultPaymentInstrumentId());
$this->payment_instrument_id = $defaults['payment_instrument_id'] ?? $this->getDefaultPaymentInstrumentId();
CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, FALSE, TRUE, $this->payment_instrument_id);
if (!empty($this->_recurPaymentProcessors)) {
$buildRecurBlock = TRUE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment