Commit 6e8998dd authored by mattwire's avatar mattwire Committed by mattwire
Browse files

Use helper functions to set payment status

parent edd64cfc
......@@ -454,12 +454,7 @@ trait CRM_Core_Payment_MJWTrait {
// If we have a $0 amount, skip call to processor and set payment_status to Completed.
// https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Payment.php#L1362
if ($propertyBag->getAmount() == 0) {
return [
'payment_status_id' => CRM_Core_PseudoConstant::getKey(
'CRM_Contribute_BAO_Contribution',
'contribution_status_id', 'Completed'
)
];
return $this->setStatusPaymentCompleted([]);
}
else {
return FALSE;
......@@ -518,7 +513,7 @@ trait CRM_Core_Payment_MJWTrait {
// We need to set this to ensure that contributions are set to the correct status
// It should have already been set to "Completed" if we made a successful payment
if (empty($params['payment_status_id'])) {
$this->setStatusPaymentPending($params);
$params = $this->setStatusPaymentPending($params);
}
return $params;
......@@ -543,8 +538,8 @@ trait CRM_Core_Payment_MJWTrait {
* @return array
*/
protected function setStatusPaymentCompleted(array $params) {
$returnParams['payment_status_id'] = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed');
$returnParams['payment_status'] = 'Completed';
$params['payment_status_id'] = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed');
$params['payment_status'] = 'Completed';
return $params;
}
......
......@@ -14,7 +14,7 @@
<url desc="Release Notes">https://lab.civicrm.org/extensions/mjwshared/-/blob/master/docs/releasenotes.md</url>
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2021-04-05</releaseDate>
<releaseDate>2021-04-06</releaseDate>
<version>1.0-dev</version>
<develStage>beta</develStage>
<compatibility>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment