Skip to content
Snippets Groups Projects
Unverified Commit 02a9121f authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #17624 from eileenmcnaughton/526

Fix payment instrument bug by using correct payment instrument
parents ad715a3f 3dae6993
Branches
Tags
No related merge requests found
......@@ -661,14 +661,15 @@ WHERE contribution_id = {$id}
/**
* Get the default payment instrument id.
*
* This priortises the submitted value, if any and falls back on the processor.
*
* @return int
*
* @throws \CRM_Core_Exception
*/
protected function getDefaultPaymentInstrumentId() {
$paymentInstrumentID = CRM_Utils_Request::retrieve('payment_instrument_id', 'Integer');
if ($paymentInstrumentID) {
return $paymentInstrumentID;
}
return key(CRM_Core_OptionGroup::values('payment_instrument', FALSE, FALSE, FALSE, 'AND is_default = 1'));
return (int) ($paymentInstrumentID ?? $this->_paymentProcessor['payment_instrument_id']);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment