);
}
- $participantPayment = civicrm_api3('ParticipantPayment', 'get', ['contribution_id' => $contributionID, 'return' => 'participant_id', 'sequential' => 1])['values'];
- if (!empty($participantPayment) && empty($input['IAmAHorribleNastyBeyondExcusableHackInTheCRMEventFORMTaskClassThatNeedsToBERemoved'])) {
- $participantParams['id'] = $participantPayment[0]['participant_id'];
- $participantParams['status_id'] = 'Registered';
- civicrm_api3('Participant', 'create', $participantParams);
+ $participantPayments = civicrm_api3('ParticipantPayment', 'get', ['contribution_id' => $contributionID, 'return' => 'participant_id', 'sequential' => 1])['values'];
+ if (!empty($participantPayments) && empty($input['IAmAHorribleNastyBeyondExcusableHackInTheCRMEventFORMTaskClassThatNeedsToBERemoved'])) {
+ foreach ($participantPayments as $participantPayment) {
+ $participantParams['id'] = $participantPayment['participant_id'];
+ $participantParams['status_id'] = 'Registered';
+ civicrm_api3('Participant', 'create', $participantParams);
+ }
}
$contributionParams['id'] = $contributionID;
'module' => 'CiviEvent',
];
- list($custom_pre_id,
- $custom_post_ids
- ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
+ [$custom_pre_id, $custom_post_ids] = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
$values['custom_pre_id'] = $custom_pre_id;
$values['custom_post_id'] = $custom_post_ids;
$paymentParticipant = [
'contribution_id' => $contribution['id'],
];
- $participantPayment = $this->callAPISuccess('ParticipantPayment', 'getsingle', $paymentParticipant);
- $participant = $this->callAPISuccess('participant', 'get', ['id' => $participantPayment['participant_id']]);
- $this->assertEquals('Registered', $participant['values'][$participant['id']]['participant_status']);
+ $this->callAPISuccessGetCount('ParticipantPayment', $paymentParticipant, 2);
+ $this->callAPISuccessGetCount('Participant', ['status_id' => 'Registered'], 2);
}
/**
$paymentParticipant = [
'contribution_id' => $contribution['id'],
];
- $participantPayment = $this->callAPISuccess('ParticipantPayment', 'getsingle', $paymentParticipant);
- $participant = $this->callAPISuccess('participant', 'get', ['id' => $participantPayment['participant_id']]);
- $this->assertEquals('Registered', $participant['values'][$participant['id']]['participant_status']);
+ $this->callAPISuccessGetCount('ParticipantPayment', $paymentParticipant, 2);
+ $this->callAPISuccessGetCount('participant', ['status_id' => 'Registered'], 2);
}
/**