civicrm_api3('MembershipPayment', 'create', $membershipPaymentParams);
}
}
+ if ($lineItemBAO->entity_table === 'civicrm_participant' && $lineItemBAO->contribution_id && $lineItemBAO->entity_id) {
+ $participantPaymentParams = [
+ 'participant_id' => $lineItemBAO->entity_id,
+ 'contribution_id' => $lineItemBAO->contribution_id,
+ ];
+ if (!civicrm_api3('ParticipantPayment', 'getcount', $participantPaymentParams)) {
+ civicrm_api3('ParticipantPayment', 'create', $participantPaymentParams);
+ }
+ }
if ($id) {
// CRM-21281: Restore entity reference in case the post hook needs it
CRM_Core_Error::deprecatedWarning('This should be unreachable & tests show it is never tested.');
civicrm_api3('PledgePayment', 'create', $paymentParams);
}
- if ($entity === 'participant') {
- civicrm_api3('ParticipantPayment', 'create', $paymentParams);
- }
-
}
}
return civicrm_api3_create_success($contribution['values'] ?? [], $params, 'Order', 'create');