}
CRM_Member_BAO_MembershipLog::add($logParams, CRM_Core_DAO::$_nullArray);
- if (!empty($contributionRecurID)) {
+ if ($contributionRecurID) {
CRM_Core_DAO::setFieldValue('CRM_Member_DAO_Membership', $membership->id,
'contribution_recur_id', $contributionRecurID
);
if (!empty($membershipSource)) {
$memParams['source'] = $membershipSource;
}
- $memParams['contribution_recur_id'] = $contributionRecurID;
-
$memParams['is_test'] = $is_test;
$memParams['is_pay_later'] = $isPayLater;
}
-
+ // Putting this in an IF is precautionary as it seems likely that it would be ignored if empty, but
+ // perhaps shouldn't be?
+ if ($contributionRecurID) {
+ $memParams['contribution_recur_id'] = $contributionRecurID;
+ }
//CRM-4555
//if we decided status here and want to skip status
//calculation in create( ); then need to pass 'skipStatusCal'.
'return' => $mapping,
));
+ $returnParams = array('is_recur' => TRUE);
foreach ($mapping as $recurringFieldName => $membershipTypeFieldName) {
$contributionRecurParams[$recurringFieldName] = $membershipType[$membershipTypeFieldName];
+ $returnParams[$recurringFieldName] = $membershipType[$membershipTypeFieldName];
}
$contributionRecur = civicrm_api3('ContributionRecur', 'create', $contributionRecurParams);
- $returnParams = array(
- 'contributionRecurID' => $contributionRecur['id'],
- 'is_recur' => TRUE,
- );
+ $returnParams['contributionRecurID'] = $contributionRecur['id'];
return $returnParams;
}
if (!empty($paymentParams['auto_renew'])) {
$contributionRecurParams = $this->processRecurringContribution($paymentParams);
+ $this->_params['contributionRecurID'] = $contributionRecurParams['contributionRecurID'];
$paymentParams = array_merge($paymentParams, $contributionRecurParams);
}
- $result = &$payment->doDirectPayment($paymentParams);
+ $result = $payment->doDirectPayment($paymentParams);
if (is_a($result, 'CRM_Core_Error')) {
CRM_Core_Error::displaySessionError($result);