X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FPayment%2FManual.php;h=360055e5c8e33737615909196d39ca08b4e9c242;hb=415a9951148804ba9a43d952483171d1e6a6cce8;hp=7889ccc2ed211fda7fc312fe63ec4bda2cef676c;hpb=05f7fac137353fcf3bd875941cc09ce7958d4ee2;p=civicrm-core.git diff --git a/CRM/Core/Payment/Manual.php b/CRM/Core/Payment/Manual.php index 7889ccc2ed..360055e5c8 100644 --- a/CRM/Core/Payment/Manual.php +++ b/CRM/Core/Payment/Manual.php @@ -111,8 +111,18 @@ class CRM_Core_Payment_Manual extends CRM_Core_Payment { * @throws \Civi\Payment\Exception\PaymentProcessorException */ public function doPayment(&$params, $component = 'contribute') { - $params['payment_status_id'] = $this->getResult(); - return $params; + $result['payment_status_id'] = $this->getResult(); + if ($result['payment_status_id'] == CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Pending')) { + $result = $this->setStatusPaymentPending($result); + } + elseif ($result['payment_status_id'] == CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed')) { + $result = $this->setStatusPaymentCompleted($result); + } + else { + throw new \Civi\Payment\Exception\PaymentProcessorException('Result from doPayment MUST be one of Completed|Pending'); + } + + return $result; } /**