projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
639cf34
)
CRM-20336: Failed contributions should be set as failed, not left as pending.
author
Mathieu Lutfy
<mathieu@bidon.ca>
Thu, 23 Mar 2017 15:14:52 +0000
(11:14 -0400)
committer
Mathieu Lutfy
<mathieu@bidon.ca>
Thu, 23 Mar 2017 15:14:52 +0000
(11:14 -0400)
CRM/Contribute/BAO/Contribution.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Contribute/BAO/Contribution.php
b/CRM/Contribute/BAO/Contribution.php
index 60b197bd78dfaa63166884febba6f437412a480f..846b6314cc6296e71c3485ca920a06b6181ce775 100644
(file)
--- a/
CRM/Contribute/BAO/Contribution.php
+++ b/
CRM/Contribute/BAO/Contribution.php
@@
-1053,6
+1053,15
@@
LEFT JOIN civicrm_line_item i ON ( i.contribution_id = c.id AND i.entity_table
'source_contact_id' => CRM_Core_Session::getLoggedInContactID() ? CRM_Core_Session::getLoggedInContactID() :
$contactID,
));
+
+ // CRM-20336 Make sure that the contribution status is Failed, not Pending.
+ $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
+ $failed = array_search('Failed', $contributionStatus);
+
+ civicrm_api3('contribution', 'create', array(
+ 'id' => $contributionID,
+ 'contribution_status_id' => $failed,
+ ));
}
/**