Skip to content

Commit

Permalink
Merge pull request #18046 from eileenmcnaughton/trans
Browse files Browse the repository at this point in the history
[REF] Remove transaction from completeOrder signature
  • Loading branch information
eileenmcnaughton authored Aug 3, 2020
2 parents 02b46eb + 884f782 commit d40ae7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -4405,8 +4405,6 @@ public static function isSingleLineItem($id) {
* @param array $input
* @param array $ids
* @param array $objects
* @param CRM_Core_Transaction $transaction
* It is not recommended to pass this in. The calling function handle it's own roll back if it wants it.
* @param bool $isPostPaymentCreate
* Is this being called from the payment.create api. If so the api has taken care of financial entities.
* Note that our goal is that this would only ever be called from payment.create and never handle financials (only
Expand All @@ -4416,10 +4414,8 @@ public static function isSingleLineItem($id) {
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
public static function completeOrder($input, &$ids, $objects, $transaction = NULL, $isPostPaymentCreate = FALSE) {
if (!$transaction) {
$transaction = new CRM_Core_Transaction();
}
public static function completeOrder($input, &$ids, $objects, $isPostPaymentCreate = FALSE) {
$transaction = new CRM_Core_Transaction();
$contribution = $objects['contribution'];
$primaryContributionID = $contribution->id ?? $objects['first_contribution']->id;
// The previous details are used when calculating line items so keep it before any code that 'does something'
Expand Down
2 changes: 1 addition & 1 deletion api/v3/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ function _ipn_process_transaction(&$params, $contribution, $input, $ids, $firstC
}
$input['card_type_id'] = $params['card_type_id'] ?? NULL;
$input['pan_truncation'] = $params['pan_truncation'] ?? NULL;
return CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $objects, NULL,
return CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $objects,
$params['is_post_payment_create'] ?? NULL);
}

Expand Down

0 comments on commit d40ae7d

Please sign in to comment.