Skip to content

Commit

Permalink
Merge pull request #907 from MegaphoneJon/softcredit-fix
Browse files Browse the repository at this point in the history
Don't overwrite existing soft credits
  • Loading branch information
jitendrapurohit authored Sep 23, 2023
2 parents 88d943b + a7f4886 commit cee358a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/WebformCivicrmPostProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -2317,13 +2317,12 @@ private function processContribution() {
}
}
// Save honoree
// FIXME: these api params were deprecated in 4.5, should be switched to use soft-credits when we drop support for 4.4
if (!empty($contribution['honor_contact_id']) && !empty($contribution['honor_type_id'])) {
$this->utils->wf_civicrm_api('contribution', 'create', [
'id' => $id,
'total_amount' => $contribution['total_amount'],
'honor_contact_id' => $contribution['honor_contact_id'],
'honor_type_id' => $contribution['honor_type_id'],
$this->utils->wf_civicrm_api('contribution_soft', 'create', [
'contribution_id' => $id,
'amount' => $contribution['total_amount'],
'contact_id' => $contribution['honor_contact_id'],
'soft_credit_type_id' => $contribution['honor_type_id'],
]);
}

Expand Down

0 comments on commit cee358a

Please sign in to comment.