Simplify parameters passed to completeOrder
authoreileen <emcnaughton@wikimedia.org>
Sun, 6 Sep 2020 23:00:15 +0000 (11:00 +1200)
committereileen <emcnaughton@wikimedia.org>
Thu, 10 Sep 2020 19:43:56 +0000 (07:43 +1200)
commit01a5d8d498a250e73c11089c392c6587a8907706
tree580fd8a7e1bca97f38217f7f66d693852dfb4267
parentfd364ea9b9bf04949e17b6f735b8f8367e0ce70b
Simplify parameters passed to completeOrder

Now that completeOrder has had most interaction with objects var cleaned up
we know only 2 objects are actually used
- contribution - which we can fetch in-function
- paymentProcessor - which we were actually only guessing

This alters it to only load & pass contribution. The value of passing in
processor seems lost in time. This code can only be reached for pay_later contributions - see

CRM_Contribute_BAO_Contribution::checkOnlinePendingContribution
and specifically
https://github.com/civicrm/civicrm-core/blob/318c63045e82d30ed7fe8cdacb91a6d31fc5331b/CRM/Contribute/BAO/Contribution.php#L2033

and only when submitted via an online event (same function) so by definition there IS NO PAYMENT PROCESSOR that applies.

Given that we can just do the minimum to load the contribution and pass that in.
CRM/Event/Form/Task/Batch.php