*
* @param array $input
* @param array $ids
- * @param \CRM_Contribute_BAO_Contribution $contribution
+ * @param int|null $contributionID
* @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
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
- public static function completeOrder($input, $ids, $contribution, $isPostPaymentCreate = FALSE) {
+ public static function completeOrder($input, $ids, $contributionID, $isPostPaymentCreate = FALSE) {
$transaction = new CRM_Core_Transaction();
// @todo see if we even need this - it's used further down to create an activity
// but the BAO layer should create that - we just need to add a test to cover it & can
// Unset ids just to make it clear it's not used again.
unset($ids);
- $contributionID = !empty($contribution->id) ? (int) $contribution->id : NULL;
$inputContributionWhiteList = [
'fee_amount',
CRM_Contribute_BAO_Contribution::completeOrder($input, [
'participant' => NULL,
'contributionRecur' => $recur->id,
- ], $contribution);
+ ], $contribution->id ?? NULL);
return $isFirstOrLastRecurringPayment;
}
'related_contact' => $ids['related_contact'] ?? NULL,
'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL,
'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL,
- ], $objects['contribution']);
+ ], $objects['contribution']->id ?? NULL);
}
/**
return;
}
- CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $contribution);
+ CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $contribution->id ?? NULL);
}
/**
return;
}
- CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $contribution);
+ CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $contribution->id ?? NULL);
}
/**
'related_contact' => NULL,
'participant' => $params['component_id'],
'contributionRecur' => NULL,
- ], $contribution);
+ ], $contribution->id ?? NULL);
// reset template values before processing next transactions
$template->clearTemplateVars();
'related_contact' => $ids['related_contact'] ?? NULL,
'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL,
'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL,
- ], $objects['contribution'],
+ ], $objects['contribution']->id ?? NULL,
$params['is_post_payment_create'] ?? NULL);
}